ChannelServices.RegisterChannel Method (IChannel)


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

Note: This API is now obsolete.

Registers a channel with the channel services. RegisterChannel(IChannel) is obsolete. Please use RegisterChannel(IChannel, Boolean) instead.

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

[ObsoleteAttribute("Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.", 
[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.RemotingConfiguration)]
public static void RegisterChannel(
	IChannel chnl


Type: System.Runtime.Remoting.Channels.IChannel

The channel to register.

Exception Condition

The chnl parameter is null.


The channel has already been registered.


At least one of the callers higher in the callstack does not have permission to configure remoting types and channels.


RegisterChannel(IChannel) is obsolete. Please use RegisterChannel(IChannel, Boolean) instead.

The RegisterChannel method takes in the IChannel interface from a channel object. The channel's ChannelName must be unique, or the channel must be anonymous. A channel is anonymous if the IChannel.ChannelName is set to either null or Empty by using the name configuration property.

You cannot register two channels with the same name in a AppDomain. By default, the name of a HttpChannel is "http" and the name of a TcpChannel is "tcp." Therefore, if you want to register two channels of the same type, you must specify a different name for one of them through configuration properties.

For more information about channel configuration properties, see HttpChannel, and <channel> Element (Template).

      HttpChannel channel = new HttpChannel(9000);

      RemotingConfiguration.RegisterWellKnownServiceType( typeof(SampleService), 
"MySampleService/SampleService.soap", WellKnownObjectMode.Singleton);

      Console.WriteLine("** Press enter to end the server process. **");


For configuration of the remoting infrastructure. Demand value: SecurityAction.Demand; Permission value: SecurityPermissionFlag.RemotingConfiguration

.NET Framework
Available since 1.1
Return to top