static void

The JSON request was too large to be deserialized.

Published Thursday 08 August 2013

I hit this error when a json client was calling an ASP MVC controller to get Json.

Exception Details: System.InvalidOperationException: The JSON request was too large to be deserialized.

The posted JSON is large, but not the default maximum of 4Mb.

There is a .Net security fix (http://support.microsoft.com/kb/2661403):

Microsoft security update MS11-100 limits the maximum number of form keys, files, and JSON members to 1000 in an HTTP request.

You can bypass this (at the risk of Denial of service) with an appSetting in web.config:


  <appSettings>     <add key="aspnet:MaxJsonDeserializerMembers" value="150000" />

Previously: Nuget vs jQuery 2 (13 Jun 2013)