I try to parse a JSON structure with JSON.NET. All properties of the first level is deserializing correctly.
I have a problem to deserialize a Dictionary. The object type can be anything: string, double, int, bool, List, Dictionary and recursively.
Example JSON:
{
"id":"56d4f8sd4f86ds4f",
"name":"Azerty",
"dynProp": {
"xp":100,
"life":100,
"bonus": {
"force": 100,
"defense": 100
},
"ennemies": {
"beast": {
"wolf": 100,
"bear": 20
}
}
}
}
All datas in the dynProp node is dynamic and I can't know the object type, the depth or anything.
The ouput for the dynProp object is something like that:
{{"dynProp","{xp:100, life: 100, bonus: {...}, ...}"}}
In fact, JSON.NET put in the object value the jobject and not at all inners dictionaries or stuff like that.
I try to add Serialization Settings like that:
new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All,
TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple
}
But with no success...
Thanks in advance for your help!
Edit: I'm open to another framework but it must work on .net 2.0.