This
这个答案给我带来了奇迹。我能够在app.config文件中实现它,如下所示:
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" port="1234">
<serverProviders>
<provider ref="clientinfo" />
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
<channelSinkProviders>
<serverProviders>
<provider
id="clientinfo"
type="MyNameSpace.ClientInfoServerSinkProvider, MyAssemblyName" />
</serverProviders>
</channelSinkProviders>
</system.runtime.remoting>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
我将整个serverProviders元素添加到tcp通道,并添加了您看到的整个channelSinkProviders元素。其他一切都已经作为我们现有的配置存在了。