还在苦苦敲代码开发APP?你out啦! 试试积木搭建APP吧~

Maximum number of items that can be serialized or deserialized in an object grap

来源:清泛原创     2016-06-27 11:31:47    人气:     我有话说( 0 人参与)

报错消息:Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Ch...

报错消息:
Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota.

修改如下相应的WCF配置,即可解决。
服务器端:
<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <bindings>
      ...
    </bindings>

    <services>
      <service behaviorConfiguration="ServiceBehavior" ...>
        ...
      </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>

客户端:
<system.serviceModel>
        <behaviors>
                <endpointBehaviors>
                        <behavior name="ServiceBehavior">
                                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
                        </behavior>
                </endpointBehaviors>
        </behaviors>

        <bindings>
                ...
        </bindings>

        <client>
                <endpoint ... behaviorConfiguration="ServiceBehavior" />
        </client>
</system.serviceModel>

WCF Maximum number

注:本文为本站或本站会员原创优质内容,版权属于原作者及清泛网所有,
欢迎转载,转载时须注明版权并添加来源链接,谢谢合作! (编辑:admin)
分享到: