异常详情:
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)
原因:
进行了Windows Update,安装了几个补丁,以 kb2656356 kb2656351 kb2656353 kb2656358为主会导致以上错误。
解决方案:
配置文件增加节点
<add key="aspnet:MaxJsonDeserializerMembers" value="10000" />
注意不要和http请求搞混淆,设置HTTP请求的最大许可为:<add key="aspnet:MaxHttpCollectionKeys" value="10000" />详见:微软的官方技术支持:http://support.microsoft.com/kb/2661403/zh-tw