Description
When deploying to our development DNN, PolyDeploy failed to return the expected json results. Instead we got the and error
Received error {"Message":"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."}
Triaging the DNN Admin Logs discovered the deploy failure was due to sql timeout. When a DNN deploy fails due to sql timeout the entire sql file is added to the log message. It was a very large sql file. Because DNN includes the sql that failed to run in the error message, it exceeded PolyDeploy's ability to generate the results json. This prevented our pipeline from failing gracefully.
We've resolved this issue before by ensuring the serializer supports potentially large objects for serialization, as .net doesn't look at the server web.config for max size for json serialization
using Newtonsoft.Json; JavaScriptSerializer serializer = new JavaScriptSerializer { MaxJsonLength = int.MaxValue };
I'm requesting the results handling get the serialization intitalized to support large objects so when DNN fails for sql issues, the proper results can be passed back in the json