Microsoft.Extensions.StaticAnalysis 8.10.0

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Microsoft.Extensions.StaticAnalysis --version 8.10.0                
NuGet\Install-Package Microsoft.Extensions.StaticAnalysis -Version 8.10.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Extensions.StaticAnalysis" Version="8.10.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.Extensions.StaticAnalysis --version 8.10.0                
#r "nuget: Microsoft.Extensions.StaticAnalysis, 8.10.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.Extensions.StaticAnalysis as a Cake Addin
#addin nuget:?package=Microsoft.Extensions.StaticAnalysis&version=8.10.0

// Install Microsoft.Extensions.StaticAnalysis as a Cake Tool
#tool nuget:?package=Microsoft.Extensions.StaticAnalysis&version=8.10.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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.0.0-preview.9.24507.7 59 10/8/2024
9.0.0-preview.8.24460.1 51 9/10/2024
9.0.0-preview.7.24412.10 72 8/14/2024
9.0.0-preview.6.24353.1 51 7/10/2024
9.0.0-preview.5.24311.7 66 6/11/2024
9.0.0-preview.4.24271.2 69 5/21/2024
9.0.0-preview.3.24209.3 78 4/11/2024
9.0.0-preview.2.24157.4 60 3/12/2024
9.0.0-preview.1.24108.1 80 2/13/2024
8.10.0 195 10/8/2024
8.9.1 283 9/6/2024
8.9.0 107 9/5/2024
8.8.0 270 8/13/2024
8.7.0 283 7/10/2024
8.6.0 246 6/11/2024
8.5.0 180 5/14/2024
8.4.0 297 4/9/2024
8.3.0 354 3/12/2024
8.2.0 318 2/13/2024
8.1.0 925 1/9/2024
8.0.0 520 11/14/2023
8.0.0-rc.2.23510.2 88 10/10/2023
8.0.0-rc.1.23453.1 125 9/12/2023
8.0.0-preview.7.23407.5 103 8/8/2023
8.0.0-preview.6.23360.2 89 7/12/2023
8.0.0-preview.5.23308.3 84 6/14/2023
8.0.0-preview.4.23273.7 80 5/23/2023