I have an application that's been in production for a while - it's written in c# on dotnet framework 4.5 using MVC 4.
Some of it's screens are simple things that allow edit of small data sets - they are written using knockoutjs and the whole data-view is sent to the server, edited and then downloaded again so that knockout can rebind it.
The problem started this week. The delete function won't work anymore. On debugging I found that the function wasn't being hit. By debugging in Fiddler, I have been able to remove records, and found that 83 record load, 84 or more records don't.
I thought that this was request size, but that's only 24Kbytes - I upped the MaxRequestLength to a good few megabytes to make sure - still fails.
By hollowing out the function and removing the bound parameter, the behavior doesn't change. But if I remove "Content-Type: application/json" header, all of the data uploads and my function can be hit - this suggests to me that MVC 4 parses JSON requests based on mime type whether there is a bound parameter or not, and that the JSON parser has a maximum length or complexity configuration.
Thinking about complexity, I stripped the 84th record down to just it's ID, and then I managed to receive 84 records - I can remove properties from objects from any object in the JSON and it can load the 84th record, but I can't remove bytes from descriptions etc. It's almost as if I loaded more JSON properties than MVC 4 allows, but that seems very odd to me.
Does anybody know if this is a known fault with a known workaround? Or if there are settings to control how the JSON parser works in MVC 4?
--EDIT--
Our Raygun facility managed to get an exception report that didn't come up with the debugger attached:
ERROR Uncaught MVC error 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.GetValueProvider(ControllerContext controllerContext) at System.Web.Mvc.ValueProviderFactoryCollection.<>c__DisplayClassc.b__7(ValueProviderFactory factory)
- the stack trace goes on and on, so I haven't included it all.
Thanks.