Search Issue Tracker
By Design
Votes
0
Found in
2018.4.0f1
2019.2.0a1
2019.2.0f1
2019.3.0a1
2020.1.0a1
Issue ID
1176865
Regression
No
Asmdef files do not respect API level when set to Include only Editor Platform
How to reproduce:
1. Open the "EditorAsmdefTargetDlls.zip"
2. Make sure Assets > Editor Scripts > ColorWindowEditor assembly is set to include only Editor platform
3. Observe the console
Expected Behaviour: No errors are present as the .asmdef file has a reference to .NET 2.0 API
Actual Behaviour: Errors are present showing that there is a missing reference
Reproducible with: 2018.4.7f1, 2019.2.2f1, 2019.3.0b1, 2020.1.0a1
Note: If you select "Any Platform" Checkbox and exclude every platform except the Editor - the issue is gone.
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note (2020.1.X):
By design. Editor only assemblies are always compiled against .NET Framework 4.x and runtime assemblies are compiled against the API Compatibility Level in Player settings. This is because the editor relies on types only in .NET Framework.
If you want to reference additional System assemblies such as System.Drawing.dll for editor only assemblies, you can add a csc.rsp containing "-r:System.Drawing.dll" next to the .asmdef that should reference System.Drawing.
csc.rsp adds additional C# compiler arguments and "-r:" is the argument for adding references.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/reference-compiler-option