This article is a mirror article of machine translation, please click here to jump to the original article.

View: 18714|Reply: 0

[Solved] Error when serializing or deserializing with JSON JavaScriptSerializer

[Copy link]
Posted on 10/6/2020 9:02:49 PM | | |
Looking at the exception logs, I found that when the controller was serializing the JSON, the error was reported as follows:

server error 500: Message type: InvalidOperationException <br>Message content: Error when serializing or deserializing with JSON JavaScriptSerializer. The length of the string exceeds the value set for the maxJsonLength property. <br>Exception Throwing Exception Method: Void Serialize (System.Object, System.Text.StringBuilder, SerializationFormat) <br>Exception Object: System.Web.Extensions <br>Exception Directory: Tools, <br>Exception File: WatermarkPost
The error is caused by the string exceeding the default length when serializing the JSON.

Solution 1:



Solution 2:

Add the following node to the web.config <configuration>below



Solution 3:







Previous:C# imports from Excel tables (100,000 data) into the database
Next:Build an ocserv vpn proxy on CentOS 7
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com