Tag: servicebehavior

WCF错误“对象图中可以序列化或反序列化的项的最大数目是'65536'”

我在WCF调用中收到以下错误: 在对象图中可以序列化或反序列化的项目的最大数目是'65536' 我已经阅读了大量的论坛post,其中许多人提到修改app.config和web.config来指定新的行为,以允许更大的对象图。 我已经这样做了,这是我在这些文件中的: WPF项目上的App.Config: <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="false" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name=""> <dataContractSerializer maxItemsInObjectGraph="2147483646"/> </behavior> </endpointBehaviors> </behaviors> <services> <service name="digiPM.Shell.LogOutPMSEMRService.PMSEMRLogOutService"> <!–<endpoint address="" binding="basicHttpBinding" contract="digiPM.Shell.LogOutPMSEMRService.IPMSEMRLogOutService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:8732/Design_Time_Addresses/digiPM.Shell.LogOutPMSEMRService/PMSEMRLogOutService/" /> </baseAddresses> </host>–> <endpoint address="" binding="netTcpBinding" name="NetTcpBindingEndpoint" […]