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
- Memory spike when loading a prefab using TextMeshPro in iOS Player
- [iOS] UI Toolkit's DropdownField fails to close on first tap when Windowed Apps is used
- VFX System Border text cursor is sometimes not visible
- Hub horizontal scroll hides all items when scrolled to the end
- GC Allocation of 384 B every frame when using CinemachineInputAxisController
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.