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
- [Android] The Player screen turns black when playing a video under certain conditions
- Search window icons at the bottom are cut off when Search window is resized vertically
- "Try something else?" text label is cut off when searching for a long text in the Search window
- Rendering Debugger window sections do not have a minimum width set when resizing with the slider in the middle of the window
- Last segment of a Sprite Shape Spline is affected by other segments' Sprite Variant change when no edge Sprite is selected
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