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.
Property Value The maximum length of JSON strings. The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data.
JSON is a format that encodes objects in a string. Serialization means to convert an object into that string, and deserialization is its inverse operation (convert string -> object).
Json namespace provides functionality for serializing to and deserializing from JavaScript Object Notation (JSON). Serialization is the process of converting the state of an object, that is, the values of its properties, into a form that can be stored or transmitted.
“Serializing” data is used to store and convert complex data types when writing and reading from memory. It is especially useful when sharing data between multiple systems which may not all share common data types.
There is no artificial limit.
Also internally Json.NET reads and writes over streams so there is no memory limit either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With