Skip to content

Commit fd040a1

Browse files
authored
Merge pull request #1729 from gewarren/gewarren-analyzers-tweaks
Gewarren analyzers tweaks
2 parents a652590 + 2f83dd4 commit fd040a1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs/code-quality/use-roslyn-analyzers.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ms.workload:
1919

2020
## Analyzers in Solution Explorer
2121

22-
You can do much of the customization of analyzer diagnostics from **Solution Explorer**. If you [install analyzers](../code-quality/install-roslyn-analyzers.md) as a NuGet package, an **Analyzers** node appears under the **References** node in **Solution Explorer**. If you expand **Analyzers**, and then expand one of the analyzer assemblies, you see all the diagnostics in the assembly.
22+
You can do much of the customization of analyzer diagnostics from **Solution Explorer**. If you [install analyzers](../code-quality/install-roslyn-analyzers.md) as a NuGet package, an **Analyzers** node appears under the **References** or **Dependencies** node in **Solution Explorer**. If you expand **Analyzers**, and then expand one of the analyzer assemblies, you see all the diagnostics in the assembly.
2323

2424
![Analyzers node in Solution Explorer](media/analyzers-expanded-in-solution-explorer.png)
2525

@@ -57,7 +57,7 @@ You can configure the severity of analyzer rules, or *diagnostics*, if you [inst
5757
|Error|Violations appear as *Errors* in the **Error List** and in command-line build output, and cause builds to fail.|Offending code is underlined with a red squiggly, and marked by a small red box in the scroll bar.|
5858
|Warning|Violations appear as *Warnings* in the **Error List** and in command-line build output, but do not cause builds to fail.|Offending code is underlined with a green squiggly, and marked by a small green box in the scroll bar.|
5959
|Info|Violations appear as *Messages* in the **Error List**, and not at all in command-line build output.|Offending code is underlined with a gray squiggly, and marked by a small gray box in the scroll bar.|
60-
|Hidden|Non-visible.|Non-visible.|
60+
|Hidden|Non-visible to user.|Non-visible to user. The diagnostic is reported to the IDE diagnostic engine, however.|
6161
|None|Suppressed completely.|Suppressed completely.|
6262

6363
In addition, you can "reset" a rule's severity by setting it to **Default**. Each diagnostic has a default severity that can be seen in the **Properties** window.
@@ -76,7 +76,7 @@ You can change the severity of a rule from **Solution Explorer**, or within the
7676

7777
### To set rule severity from Solution Explorer
7878

79-
1. In **Solution Explorer**, expand **References** > **Analyzers**.
79+
1. In **Solution Explorer**, expand **References** > **Analyzers** (**Dependencies** > **Analyzers** for .NET Core projects).
8080

8181
1. Expand the assembly that contains the rule you want to set severity for.
8282

@@ -120,8 +120,16 @@ There are multiple ways to suppress rule violations:
120120

121121
In the **Preview Changes** dialog, select **Apply**.
122122

123+
> [!NOTE]
124+
> In a .NET Core project, if you add a reference to a project that has NuGet analyzers, those analyzers are automatically added to the dependent project too. To disable this behavior, for example if the dependent project is a unit test project, mark the NuGet package as private in the *.csproj* or *.vbproj* file of the referenced project:
125+
>
126+
> ```xml
127+
> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.0" PrivateAssets="all" />
128+
> ```
129+
123130
## See also
124131
125132
- [Overview of Roslyn analyzers in Visual Studio](../code-quality/roslyn-analyzers-overview.md)
133+
- [Submit a Roslyn analyzer bug](https://github.com/dotnet/roslyn-analyzers/issues)
126134
- [Use rule sets](../code-quality/using-rule-sets-to-group-code-analysis-rules.md)
127135
- [Suppress code analysis warnings](../code-quality/in-source-suppression-overview.md)

0 commit comments

Comments
 (0)