This documentation is archived and is not being maintained.

ChannelServices.RegisterChannel Method (IChannel)

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.


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 [<topic://gnconchanneltemplate>].

        HttpChannel channel = new HttpChannel(9000);

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

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

.NET Framework

Supported in: 1.1, 1.0
Obsolete (compiler warning) in 4
Obsolete (compiler warning) in 3.5
Obsolete (compiler warning) in 3.5 SP1
Obsolete (compiler warning) in 3.0
Obsolete (compiler warning) in 3.0 SP1
Obsolete (compiler warning) in 3.0 SP2
Obsolete (compiler warning) in 2.0
Obsolete (compiler warning) in 2.0 SP1
Obsolete (compiler warning) in 2.0 SP2

.NET Framework Client Profile

Obsolete (compiler warning) in 4
Obsolete (compiler warning) in 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.