0

Why am I getting the "The length of the string exceeds the value set on the maxJsonLength property." error when .NET is trying to parse this large string argument (around 2MB) passed to my controller via a post? The call stack is all within .NET and I haven't changed the default value of the MaxJsonLength property, so I am very curious why this errors! If I understand correctly, the default value is much higher.

This one would make sense if I am trying to parse the argument myself, but I am not, it's all .NET: Can I set an unlimited length for maxJsonLength in web.config?

EDIT: .NET 4.5/MVC 4

praveen_r
  • 869
  • 2
  • 10
  • 19
  • You need to set JavaScriptSerializer MaxJsonLength from code as the setting specified in web.config JsonSerialization is for web service. Here is ['my answer'](https://stackoverflow.com/questions/47257227/the-length-of-the-string-exceeds-the-value-set-on-the-maxjsonlength-property-c/47258664#47258664) – Akash KC Dec 12 '17 at 02:33
  • related to the above statement, what framework are you using on the backend? WCF? MVC? Web Api? – swestner Dec 12 '17 at 02:38
  • swestner - Framework mentioned above; Akash - doesn't apply to this scenario, please see my comment below. – praveen_r Dec 12 '17 at 12:33

0 Answers0