共用方式為


<channelSinkProviders> Element

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.

<configuration>
   <system.runtime.remoting>
      <channelSinkProviders>

<channelSinkProviders>
   <serverProviders>
   <clientProviders>
</<channelSinkProviders>

Child Elements

Element Description
<serverProviders> Contains channel sink templates that can be inserted into a server channel call chain. Can occur once in the <channelSinkProviders> element.
<clientProviders> Contains channel sink templates that can be inserted into a client channel call chain. Can occur once in the <channelSinkProviders> element.

Example

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

<configuration>
   <system.runtime.remoting>
      <application>
         <client>
            <wellknown 
               type="RemoteType, RemoteAssembly"
               url="http://computername:8080/RemoteType.rem"/>
         </client>
         <channels>
            <channel ref="http">
               <clientProviders>
                  <formatter ref="soap"/>
                  <provider 
                     ref="propsetter" 
                     username="bob" 
                     writeToConsole="true"
                  >
                     <endpoint url="contoso.com:9000" password="xyz" />
                     <endpoint url="contoso.com:9001" password="123" />
                  </provider>
                  <provider ref="null" writeToConsole="true" />
               </clientProviders>
            </channel>
         </channels>
      </application>
      <channelSinkProviders>
         <clientProviders>
            <provider 
               id="propsetter" 
               type="ChannelSinkPropertySetterProvider, SinkAssembly" 
            />
            <provider 
               id="null" 
               type="NullSinkProvider, SinkAssembly" 
            />
         </clientProviders>
      </channelSinkProviders>
      <debug loadTypes="true" />
   </system.runtime.remoting>
</configuration>

Requirements

Configuration Files: Application configuration file, machine configuration file (Machine.config)

See Also

Remoting Settings Schema | Sinks and Sink Chains