This project has moved and is read-only. For the latest updates, please go here.

What is the maximum JToken/Property value length

Aug 19, 2014 at 7:00 PM

I have been using JSON.NET for a long time but now I have run accross an unexpected issue.

I am trying to deserialize a really long json string which is an array of objects; I am parsing as JToken as all I need is to locate values at certain indexes (i.e. data["users"]["user"]["birthdate"])

Usually I work with arrays of objects. It seems when it is parsing a property of one of these objects that has a really large value (in our case a string encoding of a really large file) it just fails silently... It puts the value as "" and then stops parsing the rest of the ovject. You still get a valid object back just missing data.

Furthermore it continues to process the other objects in the array, which is also a bit worrying because if something did fail durring the process, it's hard to pick out...

So, first is this a bug?

So, next I would like to know what is the longest value that it can safely parse. Is this like a setting and can it be increased? I have searched extensively online but cannot find anything.

Second how can I use JSON .NET to read the results properly, I think it would involve JSONTextReader, but would this at least fix the issue where it will return the entire value?