我得到的错误如下:
对象图中可以序列化或反序列化的最大项目数为 65536。更改对象图或增加 MaxItemsInObjectGraph 配额。
这是我的 app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IClusterControllerService">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
</binding>
<binding name="NetTcpBinding_IClusterManagementService">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint
address="some_address"
binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IClusterControllerService"
contract="ClusterControllerService.IClusterControllerService"
name="NetTcpBinding_IClusterControllerService"
behaviorConfiguration="BigObjectGraphBehavior">
</endpoint>
<endpoint
address="some_address"
binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IClusterManagementService"
contract="ClusterManagementService.IClusterManagementService"
name="NetTcpBinding_IClusterManagementService"
behaviorConfiguration="BigObjectGraphBehavior">
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="BigObjectGraphBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
似乎 maxItemsInObjectGraph 设置没有生效。还有其他地方我必须设置此设置吗?