在wcf的客户端和服务端的配置文件中 的binding节点 添加maxDepth属性 对应的值就是允许的最大深度
下面例子将深度设置为64
<bindings>
<netTcpBinding>
<binding name="TcpBinding" sendTimeout="00:10:00" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
portSharingEnabled="true">
<readerQuotas maxArrayLength="2100000" maxDepth="64"/>
<security mode="None" />
</binding>
<binding name="Login_Configuration" sendTimeout="00:01:00" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
portSharingEnabled="true">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>