【问题标题】:BlogEngine.Net Json Serialization Length Error?BlogEngine.Net Json 序列化长度错误?
【发布时间】:2012-06-11 10:41:34
【问题描述】:

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

"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 长度?

【问题讨论】:

    标签: c# blogengine.net


    【解决方案1】:

    尝试修改配置文件

    <configuration> 
      <system.web.extensions>
        <scripting>
           <webServices>
               <jsonSerialization maxJsonLength="50000000"/>
           </webServices>
        </scripting>
      </system.web.extensions>
    </configuration> 
    

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-02-07
        • 2018-07-28
        • 2018-11-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多