Search Issue Tracker
Third Party Issue
Votes
0
Found in
2019.4
2020.3
2021.2
2021.2.0f1
2022.1
Issue ID
1378700
Regression
No
Packages are inconsistent with the project API Compatibility Level setting when set to .NET Standard 2.1
How to reproduce:
1. Open the user's attached project
2. In the Project window, navigate to Packages -> Examples.Common.Unions -> CodeGen.Genesis
3. Open the script UnionGenerator.cs
4. At line 193, insert the two following lines of code: var hash = new System.HashCode(); hash.Add(0);
5. Save the script file
6. In the Project window, navigate to Assets -> Examples
7. Select the Asset "UnionGenesisSettings"
8. In the Inspector window, click the "Generate" button
9. Observe the Console
Expected result: no exceptions are thrown
Actual result: an exception is thrown: "System.ComponentModel.Win32Exception (0x80004005): ApplicationName='dotnet' <...>"
Reproducible with: 2019.4.33f1, 2020.3.24f1, 2021.2.6f1, 2022.1.0b2
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:
.asmdefs with platform "Editor" only are always compiled against the .net framework profile. To solve the issue, the .asmdef platform should be set as "all platform", and use a define constraint to avoid having it deployed with player builds (adding "UNITY_EDITOR" to the list of define constraints). This way, Unity will compile it as a .NET standard 2.1, and both the Mono runtime and .NET core will succeed in redirecting "System.HashCode, netstandard" to its correct implementation.