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
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
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.