.net 2.0 remoting 输入流为无效的二进制

来源:互联网 发布:用手机编程软件有哪些 编辑:程序博客网 时间:2024/06/05 04:28

服务端为singleton hosted in iis6.0 (win2003 server)
客户端为winform application
当客户端向服务端传递的数据超出一定范围就会抛出此异常。
数据都是DataTable,因此以为是DataTable序列化的问题,一直在网上搜索也没找到答案。这几天有空特意做了一个测试将DataTable事先序列化为byte数组,在执行时仍然如此。这才觉得应该换个角度来查找答案了。
google上一顿搜索终于找到了类似的答案,地址:http://social.msdn.microsoft.com/forums/en-US/netfxremoting/thread/bcca3ee7-969a-4d18-b395-dd2a2cea2843/
原来是iis中的参数限制了上传文件的大小,把参数调大后,测试运行正常。
  <system.web>
    <customErrors mode="Off" />
    <httpRuntime
    executionTimeout="90"
    maxRequestLength="65536"
    useFullyQualifiedRedirectUrl="false"
    minFreeThreads="8"
    minLocalRequestFreeThreads="4"
    appRequestQueueLimit="100"
    enableVersionHeader="true"
    />
  </system.web>