SaladLab / Json.Net.Unity3D

Forked Newtonsoft.Json to support Unity3D
MIT License
918 stars 169 forks source link

Can Json.Net.Unity3D run with the .NET 2.0 subset? #28

Open rockobonaparte opened 6 years ago

rockobonaparte commented 6 years ago

I had managed to get Newtonsoft.Json to run in a Unity build for my save/load serialization subsystem. However, it would crash cryptically and horrifically if I ran it as a .NET 2.0 subset build based on the "Api Compatibility Level" in the player settings. If I instead opted for the full .NET 2.0 compatibility, the crashes stopped. I decided that was enough luck for me and swapped it out for Json.Net.Unity3D, but I have had the same crash with the same workaround.

It is a hard problem to nail down because it looks like it's ultimately dying in Mono. I only get a binary dump and it never takes me to the real scene of the crime; even the Unity symbol server isn't helpful here. It's also possible this is some interplay with other things in the project, but I do know it dies in my loader's constructor approximately when it wants to mention a JObject.

rockobonaparte commented 6 years ago

Check me out--I didn't include what version of Unity I was using: Version 2017.2.0f3 (46dda1414e51) Personal Mon, 09 Oct 2017 16:54:55 GMT Branch: 2017.2/release