Exception Details:
System.InvalidOperationException:Operation is not valid due to the current state of the object.
At System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary (Int32 depth)
At System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal (Int32 depth)
At System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary (Int32 depth)
At System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal (Int32 depth)
At System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize (String input, Int32 depthlimit, JavaScriptSerializer serializer)
At System.web.script.serialization.javascriptserializer.deserialize[t] (String input)
At EM. GuBaAPI.Web.MonitorLog.Client.Test.Button5_Click (Object sender, EventArgs e)
Reason:
With Windows Update, several patches have been installed to kb2656356 kb2656351 kb2656353 kb2656358 leading to the above error.
Solution:
Configuration file Increase node
<add key= "aspnet:maxjsondeserializermembers" value= "10000"/>
Note that there is no confusion with HTTP requests, and the maximum license to set HTTP requests is:<add key= "Aspnet:maxhttpcollectionkeys" value= "10000"/>
See: Microsoft's official technical support: HTTP://SUPPORT.MICROSOFT.COM/KB/2661403/ZH-TW
JavaScriptSerializer when serializing an exception: operation is not a valid due to the current state of the object.