.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> WCF >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Serialization graph of objects exceeded the default max limits Or dataContractSerializer

Posted By:Subhransu Sekhar Jena       Posted Date: September 30, 2014    Points: 40    Category: WCF    URL: http://www.dotnetspark.com  

Serialization graph of objects exceeded the default max limits Or dataContractSerializer maxItemsInObjectGraph="Set The Length
 

If you got an issue where the serialization graph of objects exceeded the default max limits Then Simply open Web.Config and and add a tag <dataContractSerializer maxItemsInObjectGraph="Set  The Length">

If you want to load maximum number of items to serialize or deserialize then use in web.config


Examples:


<dataContractSerializer maxItemsInObjectGraph="31">



Inside Web.Config:

<behaviors>
      <endpointBehaviors>
        -----------------------------------
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend