Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael Lawrence 128 posts 200 karma points
    May 24, 2012 @ 23:30
    Michael Lawrence
    0

    The length of the string exceeds the value set on the maxJsonLength property.

    I'm getting the following error on an Umbraco 4.7.2 site. I've made the <jsonSerialization maxJsonLength="50000000"/> change to my web.config file but it had no effect. I don't have uComponents installed either as that seems to be the cause of the error for other people on this forum. The error is generated when I try to expand a node in my Content section. There are child nodes but they won't show up when I try to expand it. Any ideas?  Here is the error:

    Server Error in '/' Application.
    
    Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
    
    Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace: 
    [InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.]
       System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +588381
       System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +74
       umbraco.businesslogic.Utils.JSONSerializer.Serialize(Object obj) +11
       umbraco.cms.presentation.Trees.XmlTree.ToString(SerializedTreeType type) +97
       umbraco.cms.presentation.Trees.XmlTree.ToString() +12
       umbraco.presentation.webservices.TreeDataService.ProcessRequest(HttpContext context) +64
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

  • Michael Lawrence 128 posts 200 karma points
    May 29, 2012 @ 18:51
    Michael Lawrence
    0

    Shameless bump. Still no ideas?

  • Nicholas Westby 2034 posts 7009 karma points c-trib
    Jul 21, 2013 @ 23:30
    Nicholas Westby
    0

    I suspect you've solved this by now, but I figure I'll give a shot in the dark for a possible solution in case others come across this issue.

    I'd guess this is caused by a large content tree. And you mentioned you changed the maxJsonLength in the web.config. However, I believe the folder "Umbraco" in your install may have its own web.config. If it too sets the jsonSerialization XML node, it may be overriding the maxJsonLength from the parent web.config.

    So, the hypothetical solution would be to dig into the nested web.config and set the maxJsonLength there.

    If that's wrong and you found another solution, do let us know. :-)

  • Nicholas Westby 2034 posts 7009 karma points c-trib
    Jul 26, 2013 @ 16:11
    Nicholas Westby
    0

    Seems the Umbraco folder doesn't have a nested web.config. I must have just made that up. Oh well, strike that theory.

  • Michael Lawrence 128 posts 200 karma points
    Jul 29, 2013 @ 06:54
    Michael Lawrence
    0

    Yeah, this was on a project that was a while back. To be honest, I don't remember which one. I think it was being caused by a ridiculous number of nodes in the content tree (which were being generated erroneously). Anyway, thanks for looking into it though! :)

Please Sign in or register to post replies

Write your reply to:

Draft