serializing data using json.net size limit?

John D picture John D · Oct 7, 2011 · Viewed 9.1k times · Source

I have developed an asp.net web application and initially serialized some data to a json string using the built in javascript serializer. This became problematic as I discovered later on that there was an issue about the amount of data I was able to serialize. I kept getting ""Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property". This was quickly fixed by using json.net to serialize /deserialize my data. This implied that either there is no preset maximum size when using json.net to serialize /deserialize or that there is a limit that's higher than that used by javascriptserializer.

My question is rather straightforward. Will I run into a similar issue in the future regarding size capacity when serializing /deserializing using json.net? i.e Is there a size limit when serializing data using json.net or can I assume there is no limit and my program should be fine as the size of the database increases? I asked this question on json.net's discussion forum bbut havent heard back. I'm hoping someone here knows the answer. Thanks in advance.

Answer

James Newton-King picture James Newton-King · Oct 11, 2011

There is no artificial limit.

Also internally Json.NET reads and writes over streams so there is no memory limit either.