System.Runtime.Remoting.RemotingConfiguration.RegisterActivatedClientType Method

Registers an object Type on the client end as a type that can be activated on the server, using the given parameters to initialize a new instance of the System.Runtime.Remoting.ActivatedClientTypeEntry class.

Syntax

public static void RegisterActivatedClientType (Type type, string appUrl)

Parameters

type
The object Type.
appUrl
URL of the application where this type is activated.

Remarks

To create an instance of a client-activated object on the server, you must know its Type and it must be registered on the server end by using the RemotingConfiguration.RegisterActivatedServiceType(Type) method. To obtain a proxy for a new instance of the client-activated object, the client must first register a channel with System.Runtime.Remoting.Channels.ChannelServices and then activate the object by calling new.

To activate a client-activated object type with the new keyword, you must first register the object type on the client end using the RemotingConfiguration.RegisterActivatedClientType(Type, string) method. Calling the RemotingConfiguration.RegisterActivatedClientType(Type, string) method gives the remoting infrastructure the location of the remote application where new attempts to create it. If, on the other hand, you use the Activator.CreateInstance(Type, System.Reflection.BindingFlags, System.Reflection.Binder, Object[], System.Globalization.CultureInfo) method to create a new instance of the client-activated object, you must supply the remote application's URL as a parameter, so no prior registration on the client end is necessary. To supply the Activator.CreateInstance(Type, System.Reflection.BindingFlags, System.Reflection.Binder, Object[], System.Globalization.CultureInfo) method with the URL of the server where you want to create the object, you must encapsulate the URL in an instance of the System.Runtime.Remoting.Activation.UrlAttribute class.

For a detailed description of client-activated objects, see [<topic://cpconClientActivation>]

Requirements

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