Skip to content

Commit b06b402

Browse files
committed
Update documentation
1 parent 04208d3 commit b06b402

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ reported a the [GibHub repository](https://github.com/dotnet-project-file-analyz
7676
* [**Proj0022** Build action includes should exist](rules/Proj0022.md)
7777
* [**Proj0023** Use forward slashes in paths](rules/Proj0023.md)
7878
* [**Proj0024** Order package versions alphabetically](rules/Proj0024.md)
79-
* [**Proj0025** Migrate from ruleset file to .editorconfig file](rules/Proj0025.md)
79+
* [**Proj0025** Migrate from ruleset file to .globalconfig file](rules/Proj0025.md)
8080
* [**Proj0026** Remove IncludeAssets when redundant](rules/Proj0026.md)
8181
* [**Proj0027** Override <TargetFrameworks> with <TargetFrameworks>](rules/Proj0027.md)
8282
* [**Proj0028** Define conditions on level 1](rules/Proj0028.md)

rules/Proj0025.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ parent: General
33
ancestor: MSBuild
44
---
55

6-
# Proj0025: Migrate from ruleset file to .editorconfig file
7-
Microsoft deprecated the use of `.ruleset` in favor of `.editorconfig` files.
6+
# Proj0025: Migrate from ruleset file to .globalconfig file
7+
Microsoft deprecated the use of `.ruleset` in favor of `.globalconfig` files.
88
In Visual Studio by clicking the file, it will automatically pop up a dialog to
99
convert the ruleset.
1010

1111
Alternatively, you can download the converter yourself from [NuGet](https://www.nuget.org/packages/Microsoft.CodeAnalysis.RulesetToEditorconfigConverter).
12+
For more info: [learn.microsoft.com](https://learn.microsoft.com/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#convert-an-existing-ruleset-file-to-editorconfig-file)
1213

13-
For more info: [learn.microsoft.com])https://learn.microsoft.com/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#convert-an-existing-ruleset-file-to-editorconfig-file)
14+
Note the difference between `.editorconfig` and `.globalconfig` here. It is
15+
advised to put analyzer configuration in the `[.globalconfig` file](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig).
1416

1517
## Non-compliant
1618
``` xml
@@ -25,6 +27,26 @@ For more info: [learn.microsoft.com])https://learn.microsoft.com/visualstudio/co
2527
```
2628

2729
## Compliant
30+
``` xml
31+
<Project Sdk="Microsoft.NET.Sdk">
32+
33+
<PropertyGroup>
34+
<TargetFramework>net8.0</TargetFramework>
35+
</PropertyGroup>
36+
37+
</Project>
38+
```
39+
40+
*.globalconfig*
41+
``` ini
42+
is_global = true
43+
44+
dotnet_diagnostic.CA1000.severity = warning
45+
...
46+
```
47+
48+
or with an explicit import of a config file:
49+
2850
``` xml
2951
<Project Sdk="Microsoft.NET.Sdk">
3052

0 commit comments

Comments
 (0)