The JSON request was too large to be deserialized The JSON request was too large to be deserialized

The JSON request was too large to be deserialized is a very common error because of MVC's default size for a JSON response from the Web Api. Luckily there is a very simple solution that requires a minor change in your Web.config


Increasing JSON request with aspnet:MaxJsonDeserializerMembers

Inside of your Web.config under the AppSettings section you need to set a value in a key called aspnet:MaxJsonDeserializerMembers. This will tell the default deserialize process in a Web API call to allow much longer data results.



  

The value of 150000 can be set to valid Integer value that could probably use a little bit of trial and error to find the right value.

Published on Jan 29, 2020

Tags: ASP.NET MVC and Web API Tutorial | json

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.

Tutorials

Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.