System.Runtime.Remoting.ObjRef Class

Stores all relevant information required to generate a proxy in order to communicate with a remote object.

See Also: ObjRef Members


public class ObjRef : System.Runtime.Serialization.IObjectReference, System.Runtime.Serialization.ISerializable


A System.Runtime.Remoting.ObjRef is a serializable representation of an object that extends MarshalByRefObject (MBR). A System.Runtime.Remoting.ObjRef is used to transfer an object reference across a AppDomain boundary. Creating a System.Runtime.Remoting.ObjRef for an object is known as marshaling. You can create a System.Runtime.Remoting.ObjRef (marshal a MarshalByRefObject) either explicitly, by registering the MBR object with the remoting infrastructure (see System.Runtime.Remoting.RemotingConfiguration and RemotingServices.Marshal(MarshalByRefObject)), or implicitly, by passing an MBR object as a parameter when calling a remote object. Remoting uses System.Runtime.Remoting.ObjRef objects to store and transmit all the relevant information about the MarshalByRefObject being remoted.

The System.Runtime.Remoting.ObjRef contains information that describes the Type and class of the object being marshaled, its exact location, and communication-related information on how to reach the remoting subdivision where the object is located.

After a class implementing MarshalByRefObject is marshaled, the System.Runtime.Remoting.ObjRef that represents it is transferred through a channel into another application domain, possibly in another process or computer. When the System.Runtime.Remoting.ObjRef is deserialized (see [<topic://cpconserialization>]) in the target application domain, it is parsed to create a transparent proxy for the remote MBR object. This operation is known as unmarshaling.

A transparent proxy is an object that provides the illusion that the actual object resides in the client's space. It achieves this by forwarding calls made on it to the real object using the remoting infrastructure. The transparent proxy is itself housed by an instance of a managed run-time class of type System.Runtime.Remoting.Proxies.RealProxy. The System.Runtime.Remoting.Proxies.RealProxy implements a part of the functionality needed to forward the operations from the transparent proxy.

A proxy object can be used without regard to any remoting subdivisions within a AppDomain. Applications need not distinguish between proxy references and object references. However, service providers dealing with issues such as activation, lifetime management, and transactions need to make such distinctions.

This class makes a link demand and an inheritance demand at the class level. A System.Security.SecurityException is thrown when either the immediate caller or the derived class does not have infrastructure permission. For details about security demands, see [<topic://cpconLinkDemands>] and [<topic://cpconInheritanceDemands>].


Namespace: System.Runtime.Remoting
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0,,