Importing Metadata for remoting.

G

Guest

I am working on my first remoting application

I first created an exe application, and in it, I created a class that was a descendant of MarshalByRefObject. I want that class to be exposed to clients

//This is part of the code for myserverproject.ex
namespace myserverprojec



public int RemoteClass:MarshalByRefObjec

public int AlwaysReturn3(

return 3





So now I want to write a client that calls the "AlwaysReturn3" method of the RemoteClass

I can't add a reference, because it's an exe, not a dll, and I can't just copy and past the code, because it wouldn't be in the same assembly name.

How do I create a client project that can refer to the myserverproject.RemoteClass object, and then call a method on that object?
 
G

Guest

I found one way to accomplish what i wanted, I think

I created a DLL as part of the server exe solution. That DLL contained only the definition of an interface. Then, I redefined RemoteClass a

public class RemoteClass:MarshallByRefObject,RemoteClassInterfac


(In my first post, I had public int RemoteClass. That should have been public class RemoteClass

Now, over on the other side, I create a new instance of a RemoteClassInterface object using System.Activator

This doesn't throw any errors, but when I invoke the method itself, it tells me it cannot load the object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top