Search Issue Tracker
By Design
Votes
0
Found in
2019.3
2019.3.0f1
2020.1
2020.2
Issue ID
1228277
Regression
No
In Standalone build, File WriteAllText does not save the file when using IL2CPP or Mono with ".NET Standard" Api compitability
How to reproduce:
1. Open attached project "MinerSaveJson.zip"
2. In Project Settings, make sure that either "IL2CPP" scripting backend is selected or "Mono" scripting backend with ".NET Standard" Api compatibility Level
3. Build and Run
4. In Standalone, press Load -> Load
5. Press W to move up
6. Esc -> Save Game -> Main Menu
7. Load -> Load
8. Observe the position of the player
Expected result: player position is saved and is now above the spawn point
Actual result: player position and all the tiles were not saved, the player is at its spawn point
Reproducible with: 2019.3.13f1, 2020.1.0b8, 2020.2.0a11
Could not test with: 2018.4 due to errors in the console window
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
- Deleting multiple Tags throws “NullReferenceException”, and "Retrieving array element that was out of bounds" errors when holding the Enter key
Resolution Note:
The Newtonsoft.Json code uses System.Reflection.Emit to create code at runtime. Since IL2CPP is an ahead-of-time compiler, it does not support System.Reflection.Emit.
Mono provides a just-in-time compiler, so it does support System.Reflection.Emit. But System.Reflection.Emit is not a part of .NET Standard 2.0, so this code will only work with Mono using the .NET 4.x Api Compatibility Level.