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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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