Skip to main content
Any Framework

Microsoft recommended code quality rules and .NET API usage rules implemented as analyzers using the .NET Compiler Platform ("Roslyn").

Published
Sep 9, 2025
1y ago
Total Downloads
90.3M
90,262,497

Install

dotnet add package Microsoft.CodeAnalysis.NetAnalyzers --version 10.0.100-rc.1.25451.107

No framework information available.

README

Microsoft.CodeAnalysis.NetAnalyzers

Contains all the .NET code analysis rules (CAxxxx) that are built into the .NET SDK starting .NET5 release. The documentation for CA rules can be found at learn.microsoft.com/visualstudio/code-quality/code-analysis-for-managed-code-warnings.

You do not need to manually install this NuGet package to your project if you are using .NET5 SDK or later. These analyzers are enabled by default for projects targeting .NET5 or later. For projects targeting earlier .NET frameworks, you can enable them in your MSBuild project file by setting one of the following properties:

  1. EnableNETAnalyzers

    <PropertyGroup>
      <EnableNETAnalyzers>true</EnableNETAnalyzers>
    </PropertyGroup>
    
  2. AnalysisLevel

    <PropertyGroup>
      <AnalysisLevel>latest</AnalysisLevel>
    </PropertyGroup>
    

Changes from Previous Version

No structural changes between v10.0.0-preview.25380.108 and v10.0.100-rc.1.25451.107.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.