Newtonsoft JSON - Dynamic Objects

后端 未结 7 1909
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 09:52

I am using the Newtonsoft JSON library to perform dynamic deserialisation on incoming raw JSON and have found something that I just can\'t explain.

The starting poin

7条回答
  •  孤街浪徒
    2020-12-08 10:18

    In my case it turned out I was catching first chance exceptions, so although this exception was being thrown it was not, in fact, preventing my code from executing.

    It would still be nice to know why this happens for some content deserialized by Json.NET, but not all content. For example, I have a dynamic object i serialize with json.net in a unit test, then deserialize the serialized content. The serialized content looks identical to content which, at run time, causes runtime binder exceptions to be thrown.

提交回复
热议问题