如何設置DataContractJsonSerializer的maxItemsInObjectGraph?DataContractJsonSerializer和maxItemsInObjectGraph
我得到一個錯誤說"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."
來自哪裏數65536。 DataContractJsonSerializer的documentation表示默認值爲Int32.MaxValue。
我試圖把它的行爲的配置:
<endpointBehaviors>
<behavior name="WebBehavior">
<webHttp />
<dataContractJsonSerializer maxItemsInObjectGraph="500000"/>
</behavior>
</endpointBehaviors>
,但我得到這樣一個錯誤:"Invalid element in configuration. The extension name 'dataContractJsonSerializer' is not registered in the collection at system.serviceModel/extensions/behaviorExtensions."
改變行爲<dataContractSerializer maxItemsInObjectGraph="500000"/>
沒有給出錯誤,但不改變值(並不意外,因爲我沒有使用dataContractSerializer)
客戶端使用ChannelFactory創建,所以我不能使用這裏描述的ServiceBehavior屬性here
Blew右過去的問題dataContractSerializer位,刪除答案:) – 2011-05-03 15:02:19