<provider> 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 sink provider template for a channel sink that is to be inserted into the server or client channel sink chain. There are two possible hierarchies for the inclusion of this element. This element may occur in an application configuration file, machine configuration file.

   type="ProviderType, ProviderAssembly"    

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


Attribute Description


Required attribute.

Specifies a string that identifies this channel sink provider. Others can use this string in their ref attribute to bind to this channel sink provider.


Required attribute.

Specifies the full type name of the channel sink provider and the name of the assembly containing the provider implementation. This includes version, culture, and public key information if the containing assembly is in the global assembly cache.


Optional attribute.

Indicates a supported custom channel sink property. You can specify any number of provider and channel sink properties that custom channel sink providers and their sinks might support. A custom channel sink property would be specified with an attribute/value pair. In the example:

<provider id="CustomChannelSinkProvider" type="Namespace.CustomChannelSinkProvider, CustomChannels" customChannelSinkProperty="ChannelSinkPropertyValue"/>

the customChannelSinkProperty attribute and its value will be available as an IDictionary argument in the constructor of the provider.

Custom sink provider data can also be specified here. Only one level of nodes is supported. In the example:

<provider ref="custom">
<extra data="value"/>
<extra data="AnotherValue"/>

the extra information will be available as an ICollection of SinkProviderData in the constructor of the provider.

Child Elements


Parent Elements

Element Description


Contains templates for client and server channel sink providers. Any channel sink providers specified underneath this element can be referenced anywhere a channel sink provider might be registered.


Contains providers for channel sinks that are to become part of the default client-side channel sink call chain for this channel template when the template is referenced elsewhere in the configuration file. Specifying providers in either position below overrides the default channel sinks for this channel; if you expect any of those default channel sinks to be inserted into the channel sink call chain for this template, you must specify them here.


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


Contains information about remote objects and channels.

The following configuration file uses a <provider> instance element to assign to the HttpChannel the "propsetter" and a "null" channel sink provider that themselves were declared with <provider> template elements. In addition, the "propsetter" channel sink provider will be created with the custom provider properties specified as attributes on the provider instance element and as the child <endpoint> attribute name/value pairs.

               type="RemoteType, RemoteAssembly"
            <channel ref="http">
                  <formatter ref="soap"/>
                     <endpoint url="contoso.com:9000" someProperty="xyz" />
                     <endpoint url="contoso.com:9001" someProperty="123" />
                  <provider ref="null" writeToConsole="true" />
               type="ChannelSinkPropertySetterProvider, SinkAssembly" 
               type="NullSinkProvider, SinkAssembly" 
      <debug loadTypes="true" />

Copyright © 2007 by Microsoft Corporation. All rights reserved.

Community Additions