Export (0) Print
Expand All

RemotingServices.GetObjRefForProxy Method

Returns the ObjRef that represents the remote object from the specified proxy.

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

static member GetObjRefForProxy : 
        obj:MarshalByRefObject -> ObjRef

Parameters

obj
Type: System.MarshalByRefObject

A proxy connected to the object you want to create a ObjRef for.

Return Value

Type: System.Runtime.Remoting.ObjRef
A ObjRef that represents the remote object the specified proxy is connected to, or a null reference (Nothing in Visual Basic) if the object or proxy have not been marshaled.

ExceptionCondition
SecurityException

The immediate caller does not have infrastructure permission.

A ObjRef is a serializable representation of an object used to transfer an object reference across an application domain boundary. Creating a ObjRef for an object is known as marshaling. The ObjRef can be transferred through a channel into another application domain (possibly on another process or computer). Once in the other application domain, the ObjRef must be parsed to create a proxy for the object, generally connected to the real object. This operation is known as unmarshaling. During unmarshaling, the ObjRef is parsed to extract the method information of the remote object and both the transparent proxy and RealProxy objects are created.

A ObjRef contains information that describes the Type and class of the object being marshaled, a URI that uniquely identifies the specific object instance, and communication related information about how to reach the remote application where the object is located.

The following code example demonstrates how to get a ObjRef instance for the specified object.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Show:
© 2015 Microsoft