Skip to content

Commit

Permalink
add readme file to Microsoft.CodeAnalysis.NetAnalyzers package
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarolf committed Dec 8, 2022
1 parent f84f7a7 commit d7abfa7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ContainsPortedFxCopRules>true</ContainsPortedFxCopRules>
<AnalyzerDocumentationFileDir>$(RepoRoot)src\NetAnalyzers</AnalyzerDocumentationFileDir>
<AnalyzerSarifFileDir>$(RepoRoot)src\NetAnalyzers</AnalyzerSarifFileDir>
<PackageReadmeFile>documentation\readme.md</PackageReadmeFile>
<IsShippingPackage>true</IsShippingPackage>

<!-- Override the version prefix and label for NetAnalyzers projects -->
Expand All @@ -24,6 +25,7 @@
<AnalyzerNupkgAssembly Include="Microsoft.CodeAnalysis.NetAnalyzers.dll" />
<AnalyzerNupkgAssembly Include="Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" />
<AnalyzerNupkgAssembly Include="Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers.dll" />
<PackageReadmeFileSource Include="..\..\src\NetAnalyzers\readme.md"/>
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 21 additions & 0 deletions src/NetAnalyzers/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Microsoft.CodeAnalysis.NetAnalyzers

Contains all **the .NET code analysis rules (CAxxxx)** that are built into the .NET SDK starting .NET5 release. The documentation for CA rules can be found at [docs.microsoft.com/visualstudio/code-quality/code-analysis-for-managed-code-warnings](https://learn.microsoft.com/visualstudio/code-quality/code-analysis-for-managed-code-warnings).

You do not need to manually install this NuGet package to your project if you are using .NET5 SDK or later. These analyzers are enabled by default for projects targeting .NET5 or later. For projects targeting earlier .NET frameworks, you can enable them in your MSBuild project file by setting one of the following properties:

1. *EnableNETAnalyzers*

```xml
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
```

2. *AnalysisLevel*

```xml
<PropertyGroup>
<AnalysisLevel>latest</AnalysisLevel>
</PropertyGroup>
```

0 comments on commit d7abfa7

Please sign in to comment.