Search Issue Tracker
By Design
Votes
0
Found in
2018.3.0a6
2018.4.1f1
2019.1.0a1
2019.2.0a1
2019.3.0a1
Issue ID
1167122
Regression
No
DataContractSerializer throws a NullReferenceException in build with IL2CPP and .NET 4.x
How to reproduce:
1. Open user-submitted project (DataContractSerializerFailure)
2. Make sure you're building for IL2CPP .NET 4.x
3. Build and run the player with 'scene' in build
4. Check player.log
Expected result: no errors/exceptions are thrown
Actual result: NullReferenceException errors are thrown
Reproducible with: 2018.3.0a6, 2018.4.4f1, 2019.1.11f1, 2019.2.0b10, 2019.3.0a10
Could not test with: 2017.4.30f1(IL2CPP module not available), 2018.3.0a5(ConfigurationErrorsException thrown)
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
- Crash on JobQueue::HasJobGroupIDCompleted when closing the Editor while in Play mode on a specific project
- In "Preferences" section the “SpriteShape” menu item, the details page title “SpriteShape”, and “ControlPoint” entries are displayed as code strings rather than formatted UI strings
- Errors thrown constantly when Virtual Offset Debug is enabled and lighting was baked on AMD machine
- Persistent Memory Leak when reloading domain and using Distance-based Ghost Importance
- HDRP project doesn't render in standalone player when using High stripping
Resolution Note:
This issue can be corrected by using a link.xml file to preserve all of System.RuntimeSerialization.dll:
<linker>
<assembly fullname="System.Runtime.Serialization" preserve="all"/>
</linker>
The class library code in System.Runtime.Serialization.dll uses reflection, so the managed code stripping step in the Unity player build process removes code that the class library requires.