You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/code-quality/how-to-create-a-custom-rule-set.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
title: Create a custom code analysis rule set
3
3
ms.date: 11/02/2018
4
4
ms.topic: how-to
5
-
f1_keywords:
5
+
f1_keywords:
6
6
- vs.codeanalysis.addremoverulesets
7
-
helpviewer_keywords:
7
+
helpviewer_keywords:
8
8
- rule sets
9
9
author: mikejo5000
10
10
ms.author: mikejo
11
11
manager: jillfra
12
-
ms.workload:
12
+
ms.workload:
13
13
- multiple
14
14
---
15
15
# Customize a rule set
@@ -20,9 +20,9 @@ You can create a custom rule set to meet specific project needs for code analysi
20
20
21
21
To create a custom rule set, you can open a built-in rule set in the **rule set editor**. From there, you can add or remove specific rules, and you can change the action that occurs when a rule is violated—for example, show a warning or an error.
22
22
23
-
1. In **Solution Explorer**, select and hold (or right-click) the project and then select **Properties**.
23
+
1. In **Solution Explorer**, right-click the project and then select **Properties**.
24
24
25
-
2. On the **Properties** pages, go to the **Code Analysis** tab.
25
+
2. On the **Properties** pages, select the **Code Analysis** tab.
26
26
27
27
::: moniker range="vs-2017"
28
28
@@ -51,7 +51,7 @@ To create a custom rule set, you can open a built-in rule set in the **rule set
51
51
52
52
You can create a new rule set file from the **New File** dialog:
53
53
54
-
1. Select **File** > **New** > **File**, or select**Ctrl**+**N**.
54
+
1. Select **File** > **New** > **File**, or press**Ctrl**+**N**.
55
55
56
56
2. In the **New File** dialog box, select the **General** category on the left, and then select **Code Analysis Rule Set**.
57
57
@@ -64,9 +64,9 @@ You can create a new rule set file from the **New File** dialog:
64
64
> [!NOTE]
65
65
> The following procedure does not apply to .NET Core projects, which don't have a **Code Analysis** property tab.
66
66
67
-
1. In **Solution Explorer**, select and hold (or right-click) the project and then select **Properties**.
67
+
1. In **Solution Explorer**, right-click the project and then select **Properties**.
68
68
69
-
2. On the **Properties** pages, go to the **Code Analysis** tab.
69
+
2. On the **Properties** pages, select the **Code Analysis** tab.
Copy file name to clipboardExpand all lines: docs/code-quality/how-to-generate-code-metrics-data.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
title: Generate code metrics from the IDE or command line
3
3
ms.date: 11/02/2018
4
4
ms.topic: how-to
5
-
helpviewer_keywords:
5
+
helpviewer_keywords:
6
6
- code metrics data
7
7
- code metrics results
8
8
- code metrics [Visual Studio]
9
9
author: mikejo5000
10
10
ms.author: mikejo
11
11
manager: jillfra
12
-
ms.workload:
12
+
ms.workload:
13
13
- multiple
14
14
---
15
15
# How to: Generate code metrics data
@@ -66,23 +66,23 @@ You can configure the thresholds at which the code metrics rules fire.
66
66
67
67
## Calculate Code Metrics menu command
68
68
69
-
Generate code metrics for one or all of your open projects in the IDE by going to the **Analyze** > **Calculate Code Metrics** menu.
69
+
Generate code metrics for one or all of your open projects in the IDE by using the **Analyze** > **Calculate Code Metrics** menu.
70
70
71
71
### Generate code metrics results for an entire solution
72
72
73
73
You can generate code metrics results for an entire solution in any of the following ways:
74
74
75
75
- From the menu bar, select **Analyze** > **Calculate Code Metrics** > **For Solution**.
76
76
77
-
- In **Solution Explorer**, select and hold (or right-click) the solution and then select **Calculate Code Metrics**.
77
+
- In **Solution Explorer**, right-click the solution and then select **Calculate Code Metrics**.
78
78
79
79
- In the **Code Metrics Results** window, select the **Calculate Code Metrics for Solution** button.
80
80
81
81
The results are generated and the **Code Metrics Results** window is displayed. To view the results details, expand the tree in the **Hierarchy** column.
82
82
83
83
### Generate code metrics results for one or more projects
84
84
85
-
1. In **Solution Explorer**, choose one or more projects.
85
+
1. In **Solution Explorer**, select one or more projects.
86
86
87
87
1. From the menu bar, select **Analyze** > **Calculate Code Metrics** > **For Selected Project(s)**.
Copy file name to clipboardExpand all lines: docs/code-quality/how-to-run-code-analysis-manually-for-managed-code.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,25 @@
2
2
title: How to run code analysis manually for managed code
3
3
ms.date: 11/04/2019
4
4
ms.topic: how-to
5
-
helpviewer_keywords:
5
+
helpviewer_keywords:
6
6
- code analysis, running
7
7
- run code analysis
8
8
ms.assetid: 5086d228-f92e-4515-9708-c5b89b9e9a03
9
9
author: mavasani
10
10
ms.author: mikejo
11
11
manager: jillfra
12
-
ms.workload:
12
+
ms.workload:
13
13
- dotnet
14
14
---
15
15
# How to: Run code analysis manually for managed code (requires Visual Studio 2019 version 16.5 or later)
16
16
By default, .NET Compiler Platform ("Roslyn") code analyzers analyze your C# or Visual Basic code as you type by doing live analysis, as well as during build. Hence, you would normally not require to manually trigger code analysis. However, there are some scenarios where you may want to manually trigger code analysis:
17
17
18
18
- By default, live code analysis executes analyzers only for open files in Visual Studio. However, you may be interested in viewing code analysis warnings for all files in a specific project or solution. If so, you would want to trigger code analysis once on a project or a solution. Alternatively, you can enable continuous live code analysis to execute on entire solution. For more information, see [How to: Configure live code analysis scope for managed code](./configure-live-code-analysis-scope-managed-code.md).
19
-
- You may prefer on-demand code analysis execution workflow over continuous live analysis or build-time analysis. If so, you can disable analyzer execution during live analysis and/or build. For information about disabling analysis, see [How to disable source code analysis](disable-code-analysis.md). Then you would want to manually trigger code analysis once on a project or a solution.
19
+
- You may prefer on-demand code analysis execution workflow over continuous live analysis or build-time analysis. If so, you can disable analyzer execution during live analysis and/or build. For information about disabling analysis, see [How to disable source code analysis](disable-code-analysis.md). Then you would want to manually trigger code analysis once on a project or a solution.
20
20
21
21
### Run code analysis manually
22
22
23
-
1. In **Solution Explorer**, choose the project.
23
+
1. In **Solution Explorer**, select the project.
24
24
25
25
2. On the **Analyze** menu, select **Run Code Analysis on***Project Name*.
Copy file name to clipboardExpand all lines: docs/code-quality/in-source-suppression-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ In C++/CLI, use the macros CA\_SUPPRESS\_MESSAGE or CA\_GLOBAL\_SUPPRESS_MESSAGE
44
44
45
45
## SuppressMessage attribute
46
46
47
-
When you select **Suppress** from the context or right-click (or select and hold) menu of a code analysis warning in the **Error List**, a <xref:System.Diagnostics.CodeAnalysis.SuppressMessageAttribute> attribute is added either in your code or to the project's global suppression file.
47
+
When you select **Suppress** from the context or right-click menu of a code analysis warning in the **Error List**, a <xref:System.Diagnostics.CodeAnalysis.SuppressMessageAttribute> attribute is added either in your code or to the project's global suppression file.
48
48
49
49
The <xref:System.Diagnostics.CodeAnalysis.SuppressMessageAttribute> attribute has the following format:
Copy file name to clipboardExpand all lines: docs/code-quality/install-fxcop-analyzers.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
title: Install FxCop analyzers
3
3
ms.date: 08/03/2018
4
4
ms.topic: how-to
5
-
helpviewer_keywords:
5
+
helpviewer_keywords:
6
6
- fxcop analyzers
7
7
author: mikejo5000
8
8
ms.author: mikejo
9
9
manager: jillfra
10
-
ms.workload:
10
+
ms.workload:
11
11
- dotnet
12
12
---
13
13
# Install FxCop analyzers in Visual Studio
@@ -22,7 +22,7 @@ You can install these FxCop analyzers either as a NuGet package or as a VSIX ext
22
22
23
23
In Visual Studio 2019 version 16.3 and later, you can install the [Microsoft.CodeAnalysis.FxCopAnalyzers](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers) NuGet package directly from the project's Code Analysis properties page:
24
24
25
-
1. Right-click (or select and hold) on the project node in **Solution Explorer**, select **Properties**, and then go to the **Code Analysis** tab.
25
+
1. Right-click on the project node in **Solution Explorer**, select **Properties**, and then select the **Code Analysis** tab.
26
26
27
27

28
28
@@ -66,7 +66,7 @@ Use the following guidelines to determine which version of the FxCop analyzers p
66
66
67
67
| Visual Studio version | FxCop analyzer package version |
68
68
| - | - |
69
-
| Visual Studio 2019 (all versions) |[latest](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/)|
69
+
| Visual Studio 2019 (all versions) |[latest](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/)|
70
70
| Visual Studio 2017 version 15.9 |[2.9.10](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.9.10)|
71
71
| Visual Studio 2017 version 15.5 to 15.8 |[2.6.4](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.6.4)|
72
72
| Visual Studio 2017 version 15.3 to 15.4 |[2.3.0-beta1](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.3.0-beta1)|
Copy file name to clipboardExpand all lines: docs/code-quality/use-roslyn-analyzers.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ You can do much of the customization of analyzer diagnostics from **Solution Exp
22
22
23
23

24
24
25
-
You can view the properties of a diagnostic, including its description and default severity, in the **Properties** window. To view the properties, right-click (or select and hold) on the rule and select **Properties**, or select the rule and then select**Alt**+**Enter**.
25
+
You can view the properties of a diagnostic, including its description and default severity, in the **Properties** window. To view the properties, right-click the rule and select **Properties**, or select the rule and then press**Alt**+**Enter**.
26
26
27
27

28
28
29
-
To see online documentation for a diagnostic, right-click (or select and hold) on the diagnostic and select **View Help**.
29
+
To see online documentation for a diagnostic, right-click the diagnostic and select **View Help**.
30
30
31
31
The icons next to each diagnostic in **Solution Explorer** correspond to the icons you see in the rule set when you open it in the editor:
32
32
@@ -219,7 +219,7 @@ Visual Studio provides a convenient way to configure a rule's severity from the
219
219
220
220
Visual Studio also provides a convenient way to configure a rule's severity from the error list context menu.
221
221
222
-
1. After a violation occurs, right-click (or select and hold) the diagnostic entry in the error list.
222
+
1. After a violation occurs, right-click the diagnostic entry in the error list.
223
223
224
224
2. From the context menu, select **Set severity**.
225
225
@@ -236,12 +236,12 @@ Visual Studio also provides a convenient way to configure a rule's severity from
236
236
237
237
### Set rule severity from Solution Explorer
238
238
239
-
1. In Solution Explorer, select**References** > **Analyzers** (or **Dependencies** > **Analyzers** for .NET Core projects).
239
+
1. In Solution Explorer, expand**References** > **Analyzers** (or **Dependencies** > **Analyzers** for .NET Core projects).
240
240
241
241
2. Expand the assembly that contains the rule you want to set severity for.
242
242
243
243
::: moniker range=">=vs-2019"
244
-
3. Right-click (or select and hold) the rule and select **Set severity**. In the context menu, choose one of the severity options.
244
+
3. Right-click the rule and select **Set severity**. In the context menu, choose one of the severity options.
245
245
246
246
Visual Studio adds an entry to the EditorConfig file to configure the rule to the requested level. If your project uses a ruleset file instead of an EditorConfig file, the severity entry is added to the ruleset file.
247
247
@@ -250,7 +250,7 @@ Visual Studio also provides a convenient way to configure a rule's severity from
250
250
::: moniker-end
251
251
252
252
::: moniker range="vs-2017"
253
-
3. Right-click (or select and hold) the rule and select **Set Rule Set Severity**. In the context menu, choose one of the severity options.
253
+
3. Right-click the rule and select **Set Rule Set Severity**. In the context menu, choose one of the severity options.
254
254
255
255
The severity for the rule is saved in the active rule set file.
256
256
::: moniker-end
@@ -261,7 +261,7 @@ Visual Studio also provides a convenient way to configure a rule's severity from
261
261
262
262
1. Open the the active rule set file in one of the following ways:
263
263
264
-
- In **Solution Explorer**, double click the file, right-click (or select and hold) **References** > **Analyzers** node, and select **Open Active Rule Set**.
264
+
- In **Solution Explorer**, double click the file, right-click **References** > **Analyzers** node, and select **Open Active Rule Set**.
265
265
- On the **Code Analysis** property page for the project, select **Open** .
266
266
267
267
If this is the first time you're editing the rule set, Visual Studio makes a copy of the default rule set file, names it *\<projectname>.ruleset*, and adds it to your project. This custom rule set also becomes the active rule set for your project.
@@ -330,13 +330,13 @@ There are multiple ways to suppress rule violations:
330
330
331
331
- From the **code editor**
332
332
333
-
Place the cursor in the line of code with the violation and select**Ctrl**+**Period (.)** to open the **Quick Actions** menu. Select **Suppress CAXXXX** > **in Source/in Suppression File**.
333
+
Place the cursor in the line of code with the violation and press**Ctrl**+**Period (.)** to open the **Quick Actions** menu. Select **Suppress CAXXXX** > **in Source/in Suppression File**.
334
334
335
335

336
336
337
337
- From the **Error List**
338
338
339
-
Choose the rules you want to suppress, and then right-click (or select and hold) and select **Suppress** > **In Source/In Suppression File**.
339
+
Select the rules you want to suppress, and then right-click and select **Suppress** > **In Source/In Suppression File**.
340
340
341
341
- If you suppress **In Source**, the **Preview Changes** dialog opens and shows a preview of the C# [#pragma warning](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-pragma-warning) or Visual Basic [#Disable warning](/dotnet/visual-basic/language-reference/directives/directives) directive that's added to the source code.
Copy file name to clipboardExpand all lines: docs/xml-tools/how-to-create-an-xml-document-based-on-an-xsd-schema.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Also, note that `xs:base64Binary` content will be generated only if enumerations
37
37
38
38
1. Follow the steps in [How to: Create and edit an XSD schema file](../xml-tools/how-to-create-and-edit-an-xsd-schema-file.md).
39
39
40
-
2. In the [XML Schema Explorer](../xml-tools/xml-schema-explorer.md), select and hold (or right-click) the `PurchaseOrder` global element, and then select **Generate Sample XML**.
40
+
2. In the [XML Schema Explorer](../xml-tools/xml-schema-explorer.md), right-click the `PurchaseOrder` global element, and then select **Generate Sample XML**.
41
41
42
42
When you select this option, the PurchaseOrder.*xml* file with the following sample XML content will be generated and opened in the XML editor:
0 commit comments