Skip to main content
All rules are configured via .editorconfig using dotnet_diagnostic.<RuleId>.severity.

Severity Levels

LevelBuildDescription
errorFailsMust fix before build succeeds
warningWarnsShows in output, doesn’t fail
suggestionIDE onlyShows in editor, not in build
noneDisabledRule is off

Defaults

[*.cs]
# Errors - bugs that must be fixed
dotnet_diagnostic.AL0001.severity = error  # Primary constructor reassignment
dotnet_diagnostic.AL0003.severity = error  # Division by zero
dotnet_diagnostic.AL0007.severity = error  # GetSchema explicit implementation
dotnet_diagnostic.AL0008.severity = error  # GetSchema returns null
dotnet_diagnostic.AL0009.severity = error  # Don't call GetSchema
dotnet_diagnostic.AL0020.severity = error  # IFormCollection attribute
dotnet_diagnostic.AL0021.severity = error  # Multiple form sources
dotnet_diagnostic.AL0022.severity = error  # Mixed form collection/DTO
dotnet_diagnostic.AL0023.severity = error  # Unsupported form type
dotnet_diagnostic.AL0024.severity = error  # Form/body conflict

# Warnings - should fix
dotnet_diagnostic.AL0002.severity = warning  # Repeated negated patterns
dotnet_diagnostic.AL0004.severity = warning  # Span pattern matching
dotnet_diagnostic.AL0005.severity = warning  # Span SequenceEqual
dotnet_diagnostic.AL0006.severity = warning  # Field/parameter name conflict
dotnet_diagnostic.AL0011.severity = warning  # Lock on non-Lock
dotnet_diagnostic.AL0012.severity = warning  # Deprecated OTel convention
dotnet_diagnostic.AL0017.severity = warning  # Hardcoded version

# Suggestions - style preferences
dotnet_diagnostic.AL0013.severity = suggestion  # Missing schema URL
dotnet_diagnostic.AL0014.severity = suggestion  # Pattern matching style
dotnet_diagnostic.AL0015.severity = suggestion  # Null-guard style
dotnet_diagnostic.AL0016.severity = suggestion  # Declaration + null-check
dotnet_diagnostic.AL0025.severity = suggestion  # Static lambda

# Disabled by default
dotnet_diagnostic.AL0010.severity = none  # Type should be partial

Disable a Rule

[*.cs]
dotnet_diagnostic.AL0014.severity = none

Disable All Rules

[*.cs]
dotnet_diagnostic.AL0001.severity = none
dotnet_diagnostic.AL0002.severity = none
# ... repeat for each rule
Or exclude the analyzer package entirely in your project file.