dotnet/roslyn

IDE0320 not enabled when dotnet_analyzer_diagnostic.severity = error

Aperta

#76.222 aperta il 2 dic 2024

 (4 commenti) (10 reazioni) (1 assegnatario)C# (4257 fork)batch import
Area-Analyzershelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

Version Used:

$ dotnet --info
.NET SDK:
 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.3068a692
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/9.0.100/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  8.0.404 [/usr/share/dotnet/sdk]
  9.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Steps to Reproduce:

  1. Set dotnet_analyzer_diagnostic.severity = error in .editorconfig
  2. Build solution
  3. Observe no errors for IDE0320 in the build output

Diagnostic Id: IDE0320:

Expected Behavior: Setting dotnet_analyzer_diagnostic.severity = error in .editorconfig results in errors for IDE0320, same as all other diagnostics that are not configured to a specific diagnostic level.

Actual Behavior: No errors for IDE0320 shown in the build output. All other diagnostics are correctly reported as an error except for this one.

Note that I do see a Quick Fix for this diagnostic in Visual Studio Code, but no red squiggly line. This is the only diagnostic that does not show up - I do see a red squiggly line for all other diagnostics, which leads me to believe that this problem is related to IDE0320 only.

Image

Guida contributor