Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

<channel> Element (Template)

This topic is specific to a legacy technology that is retained for backward compatibility with existing applications and is not recommended for new development. Distributed applications should now be developed using the  Windows Communication Foundation (WCF).

Contains the channel template that the application can specify and configure to communicate with or listen to requests for remote objects. Anywhere a channel can be registered for use, you can set the id attribute of that instance channel element to the ref attribute of this template. This element may occur in an application configuration file, machine configuration file.

   type="ChannelType, ChannelAssembly"
   <!-- Available only to client configurations -->

The following sections describe attributes, child elements, and parent elements.


Attribute Description


Optional attribute.

Indicates a supported custom channel property. You can specify any number of channel properties that channels might support. A custom channel property would be specified with an attribute/value pair. For example:

<channel id="CustomChannel" type="Namespace.CustomChannel, CustomChannels" customProperty="PropertyValue"/>


Optional attribute.

Indicates whether this channel should be loaded if the client does not register a channel for the application. This value is a Boolean, and only affects client behavior. The value true indicates that .NET Framework remoting should test this channel at run time to see whether it supports a client connection using the particular protocol scheme specified in the remote activation URL. If the value is not present, the default value is false.


Optional attribute.

Used by the .NET Framework Configuration Tool to create a list of channels this application uses. The .NET Framework remoting system does not use this attribute.


Required attribute.

Provides the string that applications use to identify the channel at registration. To reference this channel template, specify this attribute as the value of the ref attribute in the instance channel element.

Child Elements

Element Description


Contains sink providers for sinks that are to be inserted into the server-side channel sink call chain. If specified, these completely override the defaults for the channel. Can occur once in the <channel> template element.


Contains sink providers for sinks that are to be inserted into the client-side channel sink call chain. If specified, these completely override the defaults for the channel. Can occur once in the <channel> template element.

Parent Elements

Element Description


Contains channel templates that the application uses to communicate with remote objects. Channels declared under this element are available for referencing anywhere a channel is registered.


The root element in every configuration file used by the common language runtime and .NET Framework applications.


Specifies the root element for the ASP.NET configuration section.

Channel templates can go in the machine configuration file, the application file, or any other file that is loaded by calling RemotingConfiguration.Configure().

The following configuration file uses a <channels> template element to declare an HttpChannel with the id "httpbinary" that uses the BinaryClientFormatterSink to serialize the remote calls. It then requests that this client application use that particular channel configuration by specifying ref="httpbinary" in the <channel> instance element inside the <application> element. Finally, it adds a "propsetter" channel sink provider and passes some custom configuration elements that will be used by that channel sink provider. Note that any use of the type attribute to specify a type in an assembly that is in the global assembly cache requires complete type information, including version, culture, and public key information. That information has been omitted from the type attributes below for brevity.

               type="ChannelSinkPropertySetterProvider, PropsSink" 
            type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting, ...." 
               <formatter                   type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting, ...."
            <channel ref="httpbinary">
                     <endpoint url="contoso.com:9000" someProperty="xyz" />
                     <endpoint url="contoso.com:9001" someProperty="123" />
               type="RemoteType, RemoteAssembly"

Community Additions

© 2015 Microsoft