Importing Metadata for remoting.

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
Back
Top