Hello community,
I spent a lot of time to try to deserialize my json data into a Dictionary<string, object>().
Json data is ok, Newtonsoft is well loaded but I always got an exception regarding “system.reflection → system.typeInitialization”
The only other topic I found was this one C# Events, passing a Dictionary object?
So I tried a lot of different type in order to make it works but without any success.
The solution is to select the specific 12.0.2 nuget package version of Newtonsoft.Json.
Once installed, go in your project folder and then open the “packages” directory.
Here you have to follow this path “packages\Newtonsoft.Json.12.0.2\lib\portable-net40+sl5+win8+wp8+wpa81”
This is where is the Newtonsoft.Json.dll that currently works with FiveM. No more “BadImageException” or “Reflection/Type” issues.