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

edx
edx
Member
506 Points
24 Posts

I am getting following error message:

EXCEPTION: System.InvalidOperationException: The JSON request was too large to be deserialized.
   at System.Web.Mvc. JsonValueProviderFactory. EntryLimitedDictionary.Add(String key, Object value)
   at System.Web.Mvc. JsonValueProviderFactory. AddToBackingStore(EntryLimitedDictionary backingStore, String prefix, Object value)
   at System.Web.Mvc. JsonValueProviderFactory. AddToBackingStore(EntryLimitedDictionary backingStore, String prefix, Object value)
   at System.Web.Mvc. JsonValueProviderFactory. AddToBackingStore(EntryLimitedDictionary backingStore, String prefix, Object value)
   at System.Web.Mvc. JsonValueProviderFactory. AddToBackingStore(EntryLimitedDictionary backingStore, String prefix, Object value)
   at System.Web.Mvc. JsonValueProviderFactory.AddToBackingStore(EntryLimitedDictionary backingStore, String prefix, Object value)
   at System.Web.Mvc.JsonValueProviderFactory.AddToBackingStore(EntryLimitedDictionary backingStore, String prefix, Object value)
   at System.Web.Mvc.JsonValueProviderFactory.AddToBackingStore(EntryLimitedDictionary backingStore, String prefix, Object value)
   at System.Web.Mvc.JsonValueProviderFactory.GetValueProvider(ControllerContext controllerContext)
   at System.Web.Mvc.ValueProviderFactoryCollection.GetValueProvider(ControllerContext controllerContext)
   at System.Web.Mvc.ControllerBase.get_ValueProvider()

Also, I added in web.config:

<system.web.extensions>
    <scripting>
        <webServices>
            <jsonSerialization maxJsonLength="2147483623"/>
        </webServices>
    </scripting>
</system.web.extensions>

But not working for me. 

Views: 12210
Total Answered: 1
Total Marked As Answer: 0
Posted On: 17-Aug-2017 05:41

Share:   fb twitter linkedin
I'm also facing same problem.
 - chkdk  18-Aug-2017 03:22
Answers
Smith
Smith
None
2568 Points
74 Posts
         

I think, you can set a higher value for aspnet:MaxJsonDeserializerMembers in the appSettings:

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

Also you can see on https://msdn.microsoft.com/en-us/library/hh975440(v=vs.120).aspx

It specifies the limit of the maximum number of items that can be present in any dictionary deserialized by the JavaScriptSerializer type.

 

Type:

Int32

Default value:

1000

Remarks:

 

Example:

 
 
<appSettings> 
<add key="aspnet:MaxJsonDeserializerMembers" value="1000" />
</appSettings>
Posted On: 18-Aug-2017 04:37
great.. you save my day, thanks...
 - xyan  19-Aug-2017 01:32
 Log In to Chat