Open briandesarmo opened 1 year ago
Doesn't your sample set MaxDepth to int.MaxValue? That basically removes the limit.
@JamesNK
Doesn't your sample set MaxDepth to int.MaxValue?
I am not the author of this issue report, but looking at the code in the opening post, it apparently does.
That basically removes the limit.
Then why the exception about the reader's MaxDepth of 64 being exceeded?
Anyways, it's not specifically the int.MaxValue value. It actually doesn't matter what value you set as long as it is larger than or equal to 68. It's always exactly the same exception mentioning a MaxDepth of 64.
Try 68. Still throwing exception about the MaxDepth of 64 being exceeded.
Try 67. Now the exception states MaxDepth being 67 that has been exceeded. Also note that the stacktrace here is different compared to when the MaxDepth setting is 68 or larger.
Something isn't right with how the MaxDepth setting is being handled.
Doesn't your sample set MaxDepth to int.MaxValue? That basically removes the limit.
Yes we are trying to use it without a limit.
If the example code is modified to omit the MetadataPropertyHandling.ReadAhead
an exception is no longer thrown. This is likely the same issue as reported in #2858
https://dotnetfiddle.net/8lXCu3
Source/destination types
See Steps to Reproduce
Source/destination JSON
See Steps to Reproduce
Expected behavior
DeserializeObject<T>(...)
respectsMaxDepth
fromJsonSerializerSettings
Actual behavior
DeserializeObject<T>(...)
does not respectMaxDepth
fromJsonSerializerSettings
Steps to reproduce
The
DeserializeObject
call in the above code works in12.0.3
, but does not work in13.0.1
,13.0.2
, or13.0.3
.The folllowing exception is thrown: