Search Issue Tracker
By Design
Votes
0
Found in
2020.3.4f1
2020.3.11f1
Issue ID
1366242
Regression
Yes
[2020.3] Compiler errors are thrown in console when using Roslyn analyzers in Editor
Reproduction steps:
1. Download the attached project: "repro_project.zip"
2. Delete the Library folder from the project directory
3. Open the project
Expected result: The project opens without issue
Actual result: The project opens, but there are a bunch of compiler errors in the Console
Reproducible with: 2020.3.4f1, 2020.3.19f1
Not reproducible with: 2019.4,31f1, 2020.3.3f1, 2021.1.23f1, 2021.2.0b14, 2022.1.0a11
Notes:
- Reproduced on Linux, macOS, and Windows
- Upon opening the project a second time, the errors are absent
- Examples of possible errors:
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/Raycasters/PhysicsRaycaster.cs(49,24): error UNT0007: Unity objects should not use null coalescing.
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Graphic.cs(488,17): error UNT0003: Method 'GetComponents' has a preferred generic overload.
Library/PackageCache/com.unity.test-framework@1.1.29/UnityEngine.TestRunner/NUnitExtensions/Commands/BeforeAfterTestCommandBase.cs(98,17): error UNT0008: Unity objects should not use null propagation.
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2020.3.X):
This is intended behaviour.
If a analyzer is needed to only run on specific assemblies, the recommended way is to use Analyzer Scope. Documentation found here: https://docs.unity3d.com/Manual/roslyn-analyzers.html