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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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