2. Marshaling-by-reference (MBR):- Here it creates a proxy on the client that is used to communicate with the remote object. The marshaling sequence of a remote object creates an ObjRef instance that itself can be serialized across the network.
Objects that are derived from “MarshalByRefObject” are always marshaled by reference.All our previous samples have classes inherited from “MarshalByRefObject”
To marshal a remote object the static method RemotingServices.Marshal() is used.
RemotingServices.Marshal() 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)