System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType Method

Registers an object Type on the service end as a well-known type, using the given parameters to initialize a new instance of System.Runtime.Remoting.WellKnownServiceTypeEntry.

Syntax

public static void RegisterWellKnownServiceType (Type type, string objectUri, WellKnownObjectMode mode)

Parameters

type
The object Type.
objectUri
The object URI.
mode
The activation mode of the well-known object type being registered. (See System.Runtime.Remoting.WellKnownObjectMode.)

Remarks

Any client that knows the URI of a registered well-known object can obtain a proxy for the object by registering the channel it prefers with System.Runtime.Remoting.Channels.ChannelServices, and activating the object by calling new or the Activator.GetObject(Type, string) method. To activate a well-known object with new, you must first register the well-known object type on the client using the RemotingConfiguration.RegisterWellKnownClientType(Type, string) method. Calling the RemotingConfiguration.RegisterWellKnownClientType(Type, string) method gives the remoting infrastructure the location of the remote object, which allows the new keyword to create it. If, on the other hand, you use the Activator.GetObject(Type, string) method to activate the well-known object, you must supply it with the object's URL as an argument, so no prior registration on the client end is necessary.

When the call arrives at the server, the .NET Framework extracts the URI from the message, examines the remoting tables to locate the reference for the object that matches the URI, and then instantiates the object if necessary, forwarding the method call to the object. If the object is registered as WellKnownObjectMode.SingleCall, it is destroyed after the method call is completed. A new instance of the object is created for each method called. The only difference between Activator.GetObject(Type, string) and new is that the former allows you to specify a URL as a parameter, and the latter obtains the URL from the configuration.

The remote object itself is not instantiated by the registration process. This only happens when a client attempts to call a method on the object or activates the object from the client side.

For a detailed description of well-known objects, see [<topic://cpconServerActivation>].

Requirements

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