Marshal by Value: Server creates copy of the remoting object's state and passes it to the client. You need to implement your classes to have marshal by value features either by implementing ISerializable interface or using
Marshal by Reference: In this type proxy is created by the reference of the server objects. Class must extend the System.MarshalByRefObject to implement marshal by reference. Here, client keeps server object reference which means round trip to server with each method call.
To marshal a remote object the static method RemotingServices.Marshal() is used which has following overloaded versions:-
public static ObjRef Marshal(MarshalByRefObject obj)
public static ObjRef Marshal(MarshalByRefObject obj, string objUri)
public static ObjRef Marshal(MarshalByRefObject obj, string objUri,Type requestedType)

Join the conversation! Your thoughts help the community grow.