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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.