2

进入管理员帖子页面时收到以下错误:

"Message":
"Error during serialization or deserialization using the JSON JavaScriptSerializer.
The length of the string exceeds the value set on the maxJsonLength property.",
"StackTrace":"   
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)
at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)
at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)", "ExceptionType":"System.InvalidOperationException"

如何增加 BlogEngine.Net 中的 JSON 长度?

4

2 回答 2

7

尝试通过更改配置文件

<configuration> 
  <system.web.extensions>
    <scripting>
       <webServices>
           <jsonSerialization maxJsonLength="50000000"/>
       </webServices>
    </scripting>
  </system.web.extensions>
</configuration> 
于 2012-06-07T11:28:28.143 回答
0

最好的方法是将 int32.maxvalue 分配给 maxJSonLength 作为 2147483647

于 2014-08-08T08:02:04.547 回答