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
- Crash on GUIManager::DoGUIEvent when focusing on the Game view window on a specific project
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
- Graphics State Collection warm-up does not work when using with Addressables Shaders
- "Baked Shadow Radius" field is visible but inactive when when the Shadow Type is set to "Hard Shadows" under the Light Component
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.