Microsoft.Extensions.StaticAnalysis 9.0.0-preview.5.24311.7

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
This is a prerelease version of Microsoft.Extensions.StaticAnalysis.
dotnet add package Microsoft.Extensions.StaticAnalysis --version 9.0.0-preview.5.24311.7
NuGet\Install-Package Microsoft.Extensions.StaticAnalysis -Version 9.0.0-preview.5.24311.7
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="9.0.0-preview.5.24311.7">
  <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 9.0.0-preview.5.24311.7
#r "nuget: Microsoft.Extensions.StaticAnalysis, 9.0.0-preview.5.24311.7"
#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=9.0.0-preview.5.24311.7&prerelease

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

  • 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.5.24311.7 53 6/11/2024
9.0.0-preview.4.24271.2 59 5/21/2024
9.0.0-preview.3.24209.3 70 4/11/2024
9.0.0-preview.2.24157.4 55 3/12/2024
9.0.0-preview.1.24108.1 72 2/13/2024
8.6.0 153 6/11/2024
8.5.0 159 5/14/2024
8.4.0 255 4/9/2024
8.3.0 309 3/12/2024
8.2.0 278 2/13/2024
8.1.0 776 1/9/2024
8.0.0 475 11/14/2023
8.0.0-rc.2.23510.2 77 10/10/2023
8.0.0-rc.1.23453.1 115 9/12/2023
8.0.0-preview.7.23407.5 98 8/8/2023
8.0.0-preview.6.23360.2 78 7/12/2023
8.0.0-preview.5.23308.3 76 6/14/2023
8.0.0-preview.4.23273.7 71 5/23/2023