Microsoft.Extensions.StaticAnalysis
10.0.0
Prefix Reserved
dotnet add package Microsoft.Extensions.StaticAnalysis --version 10.0.0
NuGet\Install-Package Microsoft.Extensions.StaticAnalysis -Version 10.0.0
<PackageReference Include="Microsoft.Extensions.StaticAnalysis" Version="10.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Microsoft.Extensions.StaticAnalysis" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.StaticAnalysis"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Microsoft.Extensions.StaticAnalysis --version 10.0.0
#r "nuget: Microsoft.Extensions.StaticAnalysis, 10.0.0"
#:package Microsoft.Extensions.StaticAnalysis@10.0.0
#addin nuget:?package=Microsoft.Extensions.StaticAnalysis&version=10.0.0
#tool nuget:?package=Microsoft.Extensions.StaticAnalysis&version=10.0.0
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.10.48)
- SonarAnalyzer.CSharp (>= 8.56.0.67649)
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 | 302 | 11/11/2025 |
| 9.10.0 | 4,285 | 10/14/2025 |
| 9.9.0 | 15,170 | 9/9/2025 |
| 9.8.0 | 994 | 8/12/2025 |
| 9.7.0 | 11,756 | 7/8/2025 |
| 9.6.0 | 557 | 6/10/2025 |
| 9.5.0 | 576 | 5/13/2025 |
| 9.4.0 | 393 | 4/8/2025 |
| 9.3.0 | 384 | 3/11/2025 |
| 9.2.0 | 35,998 | 2/11/2025 |
| 9.1.0 | 9,288 | 1/14/2025 |
| 9.0.0 | 8,665 | 11/12/2024 |
| 9.0.0-preview.9.24507.7 | 169 | 10/8/2024 |
| 9.0.0-preview.8.24460.1 | 162 | 9/10/2024 |
| 9.0.0-preview.7.24412.10 | 188 | 8/14/2024 |
| 9.0.0-preview.6.24353.1 | 167 | 7/10/2024 |
| 9.0.0-preview.5.24311.7 | 171 | 6/11/2024 |
| 9.0.0-preview.4.24271.2 | 172 | 5/21/2024 |
| 9.0.0-preview.3.24209.3 | 183 | 4/11/2024 |
| 9.0.0-preview.2.24157.4 | 172 | 3/12/2024 |
| 9.0.0-preview.1.24108.1 | 212 | 2/13/2024 |
| 8.10.0 | 1,097 | 10/8/2024 |
| 8.9.1 | 788 | 9/6/2024 |
| 8.9.0 | 286 | 9/5/2024 |
| 8.8.0 | 425 | 8/13/2024 |
| 8.7.0 | 463 | 7/10/2024 |
| 8.6.0 | 407 | 6/11/2024 |
| 8.5.0 | 325 | 5/14/2024 |
| 8.4.0 | 448 | 4/9/2024 |
| 8.3.0 | 508 | 3/12/2024 |
| 8.2.0 | 473 | 2/13/2024 |
| 8.1.0 | 1,147 | 1/9/2024 |
| 8.0.0 | 691 | 11/14/2023 |
| 8.0.0-rc.2.23510.2 | 203 | 10/10/2023 |
| 8.0.0-rc.1.23453.1 | 240 | 9/12/2023 |
| 8.0.0-preview.7.23407.5 | 236 | 8/8/2023 |
| 8.0.0-preview.6.23360.2 | 225 | 7/12/2023 |
| 8.0.0-preview.5.23308.3 | 237 | 6/14/2023 |
| 8.0.0-preview.4.23273.7 | 228 | 5/23/2023 |