Search code examples
wcfweb-configdatacontractserializer

What is the maximum size we can specify for maxItemsInObjectGraph of dataContractSerializer in web.config?


What is the maximum size we can specify for maxItemsInObjectGraph of dataContractSerializer in web.config ?

Currently we have it as 22020096.And because of this sometimes the data that comes from our upstream is not getting processed successfully.After we increased it to 52020096,it works fine.

But I would like to know what is the limit for maxItemsInObjectGraph ?


Solution

  • The supported type (formatted as a string in the web.config) is an integer (as that is the type the value is mapped to), and the default value is int.MaxValue (which is 2,147,483,647). This is stated on the MSDN documentation page for MaxItemsInObjectGraph. It can't go any higher.