Built-in SDK and Roslyn analyzer activation
Lead with the analyzer stack that already ships in the .NET SDK, compiler, and Roslyn editor tooling so teams get actionable feedback in the editor, build output, and CI before adding anything custom.
The strongest analyzer story to promote first is the one developers already have: the SDK, compiler, and editor already ship first-party guidance for code quality, style, platform safety, and nullability.
- Turn on
EnableNETAnalyzerswhen a project does not already get the built-in CA rules by default. - Use
AnalysisLevel,AnalysisMode,CodeAnalysisTreatWarningsAsErrors, andEnforceCodeStyleInBuildto decide how aggressively builds and CI enforce the official baseline. - Use
Microsoft.CodeAnalysis.NetAnalyzersonly when you need the official package-based path for older targets or a NuGet-driven update cadence.
Turn on: Use EnableNETAnalyzers, AnalysisLevel, AnalysisMode, CodeAnalysisTreatWarningsAsErrors, and EnforceCodeStyleInBuild in the project file, then set per-rule severities with dotnet_diagnostic.<ID>.severity in .editorconfig.
Example rules: CA1822, IDE0028, CS8602
Encourages: turn built-in analyzers on before adding custom ones, roll out severities deliberately across editor and CI