原因:

在Silverlight+WCF RIA Service或者WCF Service的架构中,经常会遇到WCF序列化65536大小限制的问题

解决方法:

修改web.config

 <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <!--设置 maxItemsInObjectGraph -->
    <services>
     <!--注意下面这个name属性,必须改成你自己的namespace+DomainService类名!! -->
     <service name="BusinessApplication1.Web.DomainService1"
                 behaviorConfiguration="MyWCFConfig" />
     </services>
     <behaviors>
        <serviceBehaviors>
          <behavior name="MyWCFConfig">
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

相关文章:

  • 2022-01-23
  • 2021-05-21
  • 2021-09-22
  • 2021-06-07
  • 2021-07-03
  • 2021-12-17
猜你喜欢
  • 2022-02-08
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
相关资源
相似解决方案