WellKnownClientTypeEntry Class


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Holds values for an object type registered on the client as a server-activated type (single call or singleton).

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


public class WellKnownClientTypeEntry : TypeEntry

System_CAPS_pubmethodWellKnownClientTypeEntry(String, String, String)

Initializes a new instance of the WellKnownClientTypeEntry class with the given type, assembly name, and URL.

System_CAPS_pubmethodWellKnownClientTypeEntry(Type, String)

Initializes a new instance of the WellKnownClientTypeEntry class with the given type and URL.


Gets or sets the URL of the application to activate the type in.


Gets the assembly name of the object type configured to be a remote-activated type.(Inherited from TypeEntry.)


Gets the Type of the server-activated client type.


Gets the URL of the server-activated client object.


Gets the full type name of the object type configured to be a remote-activated type.(Inherited from TypeEntry.)


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns the full type name, assembly name, and object URL of the server-activated client type as a String.(Overrides Object.ToString().)

Server-activated types can be either single call or singleton. If a class is registered as a single call type, a new instance is created each time a call from the client arrives. All calls to a singleton object are handled by one instance of that object, unless that object has been collected.

Any client that knows the URI of a registered server-activated object can obtain a proxy for this object by registering the channel it prefers with ChannelServices and activating the object by calling new or Activator.GetObject. To activate a server-activated object with new, you must first register the server-activated object type on the client using the RegisterWellKnownClientType method. By calling RegisterWellKnownClientType, you are giving 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 method to activate a server-activated object, you must supply it with the object's URL as an argument, so no prior registration on the client is necessary.

For a detailed description of server-activated objects and remote object activation, see [<topic://cpconActivation>].

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

public class MyClient 
   public static void Main()
   // Create a 'HttpChannel' object and  register with channel services.
   ChannelServices.RegisterChannel(new HttpChannel());
   Console.WriteLine(" Start calling from Client One.......");
   WellKnownClientTypeEntry myWellKnownClientTypeEntry = 
                  new WellKnownClientTypeEntry(typeof(HelloServer),
   // Get the proxy object for the remote object.
   HelloServer myHelloServerObject = new HelloServer();
   // Retrieve an array of object types registered on the 
   // client end as well-known types.
   WellKnownClientTypeEntry [] myWellKnownClientTypeEntryCollection = 
   Console.WriteLine("The Application Url to activate the Remote Object :"
   Console.WriteLine("The 'WellKnownClientTypeEntry' object :"
   // Make remote method calls.
   for (int i = 0; i < 5; i++)
         Console.WriteLine(myHelloServerObject.HelloMethod(" Client One"));

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top