Microsoft.Extensions.StaticAnalysis
9.0.0-preview.4.24271.2
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.Extensions.StaticAnalysis --version 9.0.0-preview.4.24271.2
NuGet\Install-Package Microsoft.Extensions.StaticAnalysis -Version 9.0.0-preview.4.24271.2
<PackageReference Include="Microsoft.Extensions.StaticAnalysis" Version="9.0.0-preview.4.24271.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Microsoft.Extensions.StaticAnalysis" Version="9.0.0-preview.4.24271.2" />
<PackageReference Include="Microsoft.Extensions.StaticAnalysis"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Microsoft.Extensions.StaticAnalysis --version 9.0.0-preview.4.24271.2
#r "nuget: Microsoft.Extensions.StaticAnalysis, 9.0.0-preview.4.24271.2"
#:package Microsoft.Extensions.StaticAnalysis@9.0.0-preview.4.24271.2
#addin nuget:?package=Microsoft.Extensions.StaticAnalysis&version=9.0.0-preview.4.24271.2&prerelease
#tool nuget:?package=Microsoft.Extensions.StaticAnalysis&version=9.0.0-preview.4.24271.2&prerelease
Microsoft.Extensions.StaticAnalysis
A curated set of code analyzers and code analyzer settings.
Install the package
From the command-line:
dotnet add package Microsoft.Extensions.StaticAnalysis
Or directly in the C# project file:
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.StaticAnalysis" Version="[CURRENTVERSION]" >
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
Usage Example
On install, a warning will be displayed that The StaticAnalysisCodeType property is not defined, assuming 'General'. The General set of diagnostics is enabled by default. To select a different set of diagnostics (or hide the warning) add the StaticAnalysisCodeType property to your project as follows.
<PropertyGroup>
<StaticAnalysisCodeType>General</StaticAnalysisCodeType>
</PropertyGroup>
Available Sets Of Diagnostics
Different pre-defined sets of diagnostics are available depending on the type of project being built. These can be specified in the StaticAnalysisCodeType property:
- Benchmark: Projects used for benchmarking.
- General: Any type of project.
- NonProdExe: Projects that produce an exe for non-production use.
- NonProdLib: Projects that produce a library (dll) for non-production use.
- ProdExe: Projects that produce an exe for production use.
- ProdLib: Projects that produce a library (dll) for production use.
- Test: Projects used for testing.
Each of these also has an optional -Tier1 and a -Tier2 variant (e.g. General-Tier1).
Tier1enables only the most important diagnostics from this set.Tier2includes Tier1 diagnostics and others that aren't as critical.- The names without
Tiersuffixes include all diagnostics from tier's 1 and 2, and any others that are applicable.
Feedback & Contributing
We welcome feedback and contributions in our GitHub repo.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.VisualStudio.Threading.Analyzers (>= 17.5.22)
- SonarAnalyzer.CSharp (>= 8.52.0.60960)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Microsoft.Extensions.StaticAnalysis:
| Repository | Stars |
|---|---|
|
Hona/VerticalSliceArchitecture
Spend less time over-engineering, and more time coding. The template has a focus on convenience, and developer confidence. Vertical Slice Architecture 🎈
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0 | 366 | 11/11/2025 |
| 9.10.0 | 5,922 | 10/14/2025 |
| 9.9.0 | 15,198 | 9/9/2025 |
| 9.8.0 | 1,009 | 8/12/2025 |
| 9.7.0 | 11,769 | 7/8/2025 |
| 9.6.0 | 570 | 6/10/2025 |
| 9.5.0 | 591 | 5/13/2025 |
| 9.4.0 | 406 | 4/8/2025 |
| 9.3.0 | 397 | 3/11/2025 |
| 9.2.0 | 36,011 | 2/11/2025 |
| 9.1.0 | 9,314 | 1/14/2025 |
| 9.0.0 | 8,679 | 11/12/2024 |
| 9.0.0-preview.9.24507.7 | 182 | 10/8/2024 |
| 9.0.0-preview.8.24460.1 | 175 | 9/10/2024 |
| 9.0.0-preview.7.24412.10 | 202 | 8/14/2024 |
| 9.0.0-preview.6.24353.1 | 180 | 7/10/2024 |
| 9.0.0-preview.5.24311.7 | 184 | 6/11/2024 |
| 9.0.0-preview.4.24271.2 | 185 | 5/21/2024 |
| 9.0.0-preview.3.24209.3 | 196 | 4/11/2024 |
| 9.0.0-preview.2.24157.4 | 185 | 3/12/2024 |
| 9.0.0-preview.1.24108.1 | 227 | 2/13/2024 |
| 8.10.0 | 1,124 | 10/8/2024 |
| 8.9.1 | 821 | 9/6/2024 |
| 8.9.0 | 300 | 9/5/2024 |
| 8.8.0 | 438 | 8/13/2024 |
| 8.7.0 | 476 | 7/10/2024 |
| 8.6.0 | 420 | 6/11/2024 |
| 8.5.0 | 338 | 5/14/2024 |
| 8.4.0 | 461 | 4/9/2024 |
| 8.3.0 | 521 | 3/12/2024 |
| 8.2.0 | 487 | 2/13/2024 |
| 8.1.0 | 1,160 | 1/9/2024 |
| 8.0.0 | 704 | 11/14/2023 |
| 8.0.0-rc.2.23510.2 | 218 | 10/10/2023 |
| 8.0.0-rc.1.23453.1 | 253 | 9/12/2023 |
| 8.0.0-preview.7.23407.5 | 249 | 8/8/2023 |
| 8.0.0-preview.6.23360.2 | 238 | 7/12/2023 |
| 8.0.0-preview.5.23308.3 | 252 | 6/14/2023 |
| 8.0.0-preview.4.23273.7 | 244 | 5/23/2023 |