异常提示:
System.ArgumentNullException: No message was deserialized prior to calling the DispatchChannelSink.
Parameter name: requestMsg
场景:
1.用IIS作宿主。
2.使用BinaryFomatter。
3.客户端订阅服务器端事件后,服务器端激活事件时产生。
解决措施:
在配置文件中将单通道改为双向通道
原配置文件:
<system.runtime.remoting>
<application>
<service>
</service>
<channels>
<channel ref="http">
<serverProviders>
<provider ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>新配置文件:
<system.runtime.remoting>
<application>
<service>
</service>
<channels>
<channel ref="http">
<serverProviders>
<provider ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<provider ref="binary"></provider>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>测试通过。
本文介绍了一种在使用IIS作为宿主,并采用BinaryFormatter时出现的.NET Remoting异常:System.ArgumentNullException。该异常通常发生在客户端订阅服务器端事件后,服务器端尝试激活事件时。文章提供了解决方案,即修改配置文件中的单向通道为双向通道。
5562

被折叠的 条评论
为什么被折叠?



