Error during serialization or deserialization using the JSON JavaScriptSerializer.

Topics: User Forum
Apr 17, 2012 at 7:45 PM

Right after trying he new vs2010 style, Im getting the following error message:

SHFB: Error BE0065: BUILD FAILED: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

Is there anywhere where I can find more exception details, like the stack trace in order to provide more info?

(I trying the build now after switching back to vs2005 style, to see if this remedies the problem.)

Apr 17, 2012 at 8:32 PM

The seralizer is used to create the full-text index for the website.  From what I can tell, the default is 2MB so perhaps one of the keyword index files is exceeding that.  Is your project very large?  Can you perhaps e-mail me an example that fails?  Most likely, it's just a matter of setting the value higher but I'd be guessing without an example although I could just set it to the maximum I suppose.  My e-mail address is in the About box in the GUI and in the footer of the pages in the help file.



Apr 18, 2012 at 12:12 AM

The project I'm documenting is closed source so I cannot send you the binaries.

The project is quite large too, it runs for almost three hours on my SSD-equipped machine.

The issue persists, even though I swittched back to vs2005. Can you tell me what you would like to have?

Apr 18, 2012 at 3:20 AM

No problem.  I'll just set it to the maximum value or something a bit lower if it doesn't like that and publish a refresh that you can test.  Do you have an urgent need for this or would an update by Monday be acceptable?



Apr 18, 2012 at 8:43 AM

No urgent need here whatsoever, take your time.

Thanks again for your prompt reply.


Apr 19, 2012 at 11:53 AM


I'm suffering with the same issue on quite a large project as well so an update (or workaround I can apply locally) would be much appreciated.

Thanks in advance,


Apr 19, 2012 at 8:17 PM

I'll have a refresh published by Monday.  If you need it sooner, you can download the source, patch it, and build it.  I haven't fixed or tested it yet but it should be just a matter of setting the MaxJsonLength property on the JavaScriptSerializer instance created in SandcastleBuilderUtils\BuildEngine\FullTextIndex.cs in the SaveIndex() method and in SandcastleBuilderGUI\Web\SearchHelp.aspx in the Render() method.  I'd set it to Int32.MaxValue as that should effectively set no limit.



Apr 20, 2012 at 4:05 PM


FYI, I got the source and applied the changes you suggested above and that allowed my project to build and be used without error.



Apr 24, 2012 at 5:18 PM

I just encountered the same issue, will this be patched soon?

Apr 24, 2012 at 8:13 PM

I didn't have time to get to it this past weekend.  It'll be done this coming weekend.  If you need it sooner, you can patch the source as noted above.



May 10, 2012 at 8:51 AM

Any chance of releasing a build with this fix?

I'm having issues building from source (although it earned me the 'Suspicious' and 'Go to hell' VS Achievements badge). : SandcastleBuilderPackage won't load because 'it is not supported by this installation'.


May 10, 2012 at 3:04 PM

I second the previous post.
It seems that the fix has been implemented however I am still having the same problem with our large code-base. 
Any help please? 


May 10, 2012 at 4:20 PM

Did you download the refresh published on 4/29?  You do need to manually uninstall SHFB first before rerunning the install.  The VSPackage should be reinstalled too but you shouldn't have to manually uninstall it first.



May 10, 2012 at 4:49 PM
Edited May 10, 2012 at 5:52 PM

I thought I did, I'll try again's running right now, and so far it's doing well.

..and it keeps running, guess this is solved and I was stupid enough not to uninstall before reinstalling.

Thank you for your time!