Microsoft.Extensions.StaticAnalysis
9.7.0
Prefix Reserved
dotnet add package Microsoft.Extensions.StaticAnalysis --version 9.7.0
NuGet\Install-Package Microsoft.Extensions.StaticAnalysis -Version 9.7.0
<PackageReference Include="Microsoft.Extensions.StaticAnalysis" Version="9.7.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Microsoft.Extensions.StaticAnalysis" Version="9.7.0" />
<PackageReference Include="Microsoft.Extensions.StaticAnalysis"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Microsoft.Extensions.StaticAnalysis --version 9.7.0
#r "nuget: Microsoft.Extensions.StaticAnalysis, 9.7.0"
#:package Microsoft.Extensions.StaticAnalysis@9.7.0
#addin nuget:?package=Microsoft.Extensions.StaticAnalysis&version=9.7.0
#tool nuget:?package=Microsoft.Extensions.StaticAnalysis&version=9.7.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
).
Tier1
enables only the most important diagnostics from this set.Tier2
includes Tier1 diagnostics and others that aren't as critical.- The names without
Tier
suffixes 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 |
---|---|---|
9.7.0 | 163 | 7/8/2025 |
9.6.0 | 423 | 6/10/2025 |
9.5.0 | 437 | 5/13/2025 |
9.4.0 | 280 | 4/8/2025 |
9.3.0 | 256 | 3/11/2025 |
9.2.0 | 32,226 | 2/11/2025 |
9.1.0 | 9,116 | 1/14/2025 |
9.0.0 | 8,549 | 11/12/2024 |
9.0.0-preview.9.24507.7 | 85 | 10/8/2024 |
9.0.0-preview.8.24460.1 | 74 | 9/10/2024 |
9.0.0-preview.7.24412.10 | 104 | 8/14/2024 |
9.0.0-preview.6.24353.1 | 81 | 7/10/2024 |
9.0.0-preview.5.24311.7 | 89 | 6/11/2024 |
9.0.0-preview.4.24271.2 | 88 | 5/21/2024 |
9.0.0-preview.3.24209.3 | 100 | 4/11/2024 |
9.0.0-preview.2.24157.4 | 84 | 3/12/2024 |
9.0.0-preview.1.24108.1 | 125 | 2/13/2024 |
8.10.0 | 834 | 10/8/2024 |
8.9.1 | 566 | 9/6/2024 |
8.9.0 | 169 | 9/5/2024 |
8.8.0 | 320 | 8/13/2024 |
8.7.0 | 343 | 7/10/2024 |
8.6.0 | 303 | 6/11/2024 |
8.5.0 | 222 | 5/14/2024 |
8.4.0 | 345 | 4/9/2024 |
8.3.0 | 393 | 3/12/2024 |
8.2.0 | 370 | 2/13/2024 |
8.1.0 | 1,008 | 1/9/2024 |
8.0.0 | 579 | 11/14/2023 |
8.0.0-rc.2.23510.2 | 117 | 10/10/2023 |
8.0.0-rc.1.23453.1 | 153 | 9/12/2023 |
8.0.0-preview.7.23407.5 | 140 | 8/8/2023 |
8.0.0-preview.6.23360.2 | 125 | 7/12/2023 |
8.0.0-preview.5.23308.3 | 130 | 6/14/2023 |
8.0.0-preview.4.23273.7 | 118 | 5/23/2023 |