异常提示:
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 >
< 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 >
< 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 >
测试通过。