System.Runtime.Remoting.Proxies.ProxyAttribute.CreateProxy Method

Creates an instance of a remoting proxy for a remote object described by the specified System.Runtime.Remoting.ObjRef, and located on the server.

Syntax

public virtual RealProxy CreateProxy (System.Runtime.Remoting.ObjRef objRef, Type serverType, object serverObject, System.Runtime.Remoting.Contexts.Context serverContext)

Parameters

objRef
The object reference to the remote object for which to create a proxy.
serverType
The type of the server where the remote object is located.
serverObject
The server object.
serverContext
The context in which the server object is located.

Returns

The new instance of remoting proxy for the remote object that is described in the specified System.Runtime.Remoting.ObjRef.

Remarks

Note:

The current method is called when a proxy is created out of aSystem.Runtime.Remoting.ObjRef instance that references a class that is marked with the System.Runtime.Remoting.Proxies.ProxyAttribute attribute. Therefore, the method is used only when a System.Runtime.Remoting.ObjRef is received from a return or parameter on a call, or during the activation of a client-activated object. The System.Runtime.Remoting.Proxies.ProxyAttribute is not used for well-known object types.

Requirements

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