Skip to content

Commit 4596601

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/visualstudio-docs-pr (branch live)
2 parents fe3aaeb + ae0a2ae commit 4596601

File tree

283 files changed

+1397
-1099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+1397
-1099
lines changed

docs/azure/vs-azure-tools-azure-project-create.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Visual Studio provides a project template that lets you create an [Azure cloud s
1818
## Steps to create an Azure cloud service project in Visual Studio
1919
This section walks you through creating an Azure cloud service project in Visual Studio with one or more web roles.
2020

21-
::: moniker range=">=vs-2019"
2221
1. From the start window, choose **Create a new project**.
2322

2423
1. In the search box, type in *Cloud*, and then choose **Azure Cloud Service**.
@@ -28,8 +27,6 @@ This section walks you through creating an Azure cloud service project in Visual
2827
1. Give the project a name and choose **Create**.
2928

3029
![Give the project a name](./media/vs-azure-tools-azure-project-create/vs-2019/new-project-cloud-service-2.png)
31-
::: moniker-end
32-
3330
1. In the **New Microsoft Azure Cloud Service** dialog, select the roles that you want to add, and choose the right arrow button to add them to your solution.
3431

3532
![Select new Azure cloud service roles](./media/vs-azure-tools-azure-project-create/new-cloud-service.png)

docs/code-quality/code-metrics-values.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ The following list shows the code metrics results that Visual Studio calculates:
4141

4242
- **Class Coupling** - Measures the coupling to unique classes through parameters, local variables, return types, method calls, generic or template instantiations, base classes, interface implementations, fields defined on external types, and attribute decoration. Good software design dictates that types and methods should have high cohesion and low coupling. High coupling indicates a design that is difficult to reuse and maintain because of its many interdependencies on other types. For more information, see [Class coupling](code-metrics-class-coupling.md).
4343

44-
::: moniker range=">=vs-2019"
4544

4645
- **Lines of Source code** - Indicates the exact number of source code lines that are present in your source file, including blank lines. This metric is available starting in Visual Studio 2019 version 16.4 and Microsoft.CodeAnalysis.Metrics (2.9.5).
4746

4847
- **Lines of Executable code** - Indicates the approximate number of executable code lines or operations. This is a count of number of operations in executable code. This metric is available starting in Visual Studio 2019 version 16.4 and Microsoft.CodeAnalysis.Metrics (2.9.5). The value is typically a close match to the previous metric, **Lines of Code**, which is the MSIL-instruction-based metric used in legacy mode.
49-
::: moniker-end
5048

5149

5250
## Anonymous methods

docs/code-quality/how-to-configure-code-analysis-for-a-managed-code-project.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,17 @@ In Visual Studio, you can choose from a list of code analysis [rule sets](../cod
4242
2. In the **Configuration** and **Platform** lists, choose the build configuration and target platform.
4343

4444

45-
::: moniker range=">=vs-2019"
46-
4745
3. To run code analysis every time the project is built using the selected configuration, select **Run on build** in the **Binary analyzers** section. You can also run legacy code analysis manually, see [How to: Run Legacy Code Analysis Manually for Managed Code](how-to-run-legacy-code-analysis-manually-for-managed-code.md) for more details.
4846

49-
::: moniker-end
5047

5148
4. To view warnings from generated code, clear the **Suppress results from generated code** check box.
5249

5350
> [!NOTE]
5451
> This option does not suppress code analysis errors and warnings from generated code when the errors and warnings appear in forms and templates. You can both view and maintain the source code for a form or a template, and it won't be overwritten.
5552
5653

57-
::: moniker range=">=vs-2019"
58-
5954
5. In the **Active rules** list, do one of the following:
6055

61-
::: moniker-end
6256

6357
- Select the rule set that you want to use.
6458

docs/code-quality/how-to-create-a-custom-rule-set.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ To create a custom rule set, you can open a built-in rule set in the **rule set
3030
2. On the **Properties** pages, select the **Code Analysis** tab.
3131

3232

33-
::: moniker range=">=vs-2019"
34-
3533
3. In the **Active rules** drop-down list, do one of the following:
3634

37-
::: moniker-end
3835

3936
- Choose the rule set that you want to customize.
4037

@@ -69,11 +66,8 @@ You can create a new rule set file from the **New File** dialog:
6966
2. On the **Properties** pages, select the **Code Analysis** tab.
7067

7168

72-
::: moniker range=">=vs-2019"
73-
7469
3. Select **\<Choose multiple rule sets>** from **Active rules**.
7570

76-
::: moniker-end
7771

7872
4. In the **Add or Remove Rule Sets** dialog box, choose the rule sets you want to include in your new rule set.
7973

docs/code-quality/how-to-enable-and-disable-automatic-code-analysis-for-managed-code.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ To enable or disable legacy code analysis:
2727
3. Specify the build type in **Configuration** and the target platform in **Platform**. (Non-.NET Core/.NET Standard projects only.)
2828

2929

30-
::: moniker range=">=vs-2019"
31-
3230
4. To enable or disable automatic code analysis, select or clear the **Run on build** check box in the **Binary analyzers** section.
3331

3432
![Run binary code analysis on build option in Visual Studio](media/run-on-build-binary-analyzers.png)
@@ -37,7 +35,6 @@ To enable or disable legacy code analysis:
3735

3836
`<RunCodeAnalysis>false</RunCodeAnalysis>`
3937

40-
::: moniker-end
4138

4239
> [!NOTE]
4340
> Disabling binary code analysis on build does not affect [.NET Compiler Platform-based code analyzers](roslyn-analyzers-overview.md), which always execute at build if you installed them as a NuGet package. For information about disabling analysis from these analyzers, see [How to disable source code analysis](disable-code-analysis.md).

docs/code-quality/how-to-generate-code-metrics-data.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ Build succeeded.
146146

147147
The generated XML output takes the following format:
148148

149-
::: moniker range=">=vs-2019"
150149

151150
```xml
152151
<?xml version="1.0" encoding="utf-8"?>
@@ -203,7 +202,6 @@ The generated XML output takes the following format:
203202
</CodeMetricsReport>
204203
```
205204

206-
::: moniker-end
207205

208206

209207
### Metrics.exe
@@ -246,19 +244,15 @@ For more information, see [Enable generating code metrics in legacy mode](https:
246244

247245
### Previous versions
248246

249-
::: moniker range=">=vs-2019"
250247
Visual Studio 2015 included a command-line code metrics tool that was also called *Metrics.exe*. This previous version of the tool did a binary analysis, that is, an assembly-based analysis. The newer version of the *Metrics.exe* tool analyzes source code instead. Because the newer *Metrics.exe* tool is source code-based, command-line code metrics results may be different to those generated by the Visual Studio IDE and by previous versions of *Metrics.exe*. Starting in Visual Studio 2019, the Visual Studio IDE analyzes source code like the command-line tool and the results should be the same.
251248

252-
::: moniker-end
253249

254250

255251
The new command-line code metrics tool computes metrics even in the presence of source code errors, as long as the solution and project can be loaded.
256252

257253
#### Metric value differences
258254

259-
::: moniker range=">=vs-2019"
260255
Starting in Visual Studio 2019 version 16.4 and Microsoft.CodeAnalysis.Metics (2.9.5), `SourceLines` and `ExecutableLines` replace the previous `LinesOfCode` metric. For descriptions of the new metrics, see [Code metrics values](../code-quality/code-metrics-values.md). The `LinesOfCode` metric is available in legacy mode.
261-
::: moniker-end
262256

263257

264258
Other metrics such as `CyclomaticComplexity` and `MaintainabilityIndex` use the same formulas as previous versions of *Metrics.exe*, but the new tool counts the number of `IOperations` (logical source instructions) instead of intermediate language (IL) instructions. The numbers will be slightly different to those generated by the Visual Studio IDE and by previous versions of *Metrics.exe*.

docs/code-quality/how-to-synchronize-code-project-rule-sets-with-team-project-check-in-policy.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ You synchronize the code analysis settings for code projects to the check-in pol
3535
2. Click **Code Analysis**.
3636

3737

38-
::: moniker range=">=vs-2019"
39-
4038
3. In the **Active rules** list, select the check-in policy rule set.
4139

42-
::: moniker-end
4340

4441
## To specify a custom check-in policy rule set
4542

@@ -50,11 +47,8 @@ You synchronize the code analysis settings for code projects to the check-in pol
5047
3. Click **Code Analysis**.
5148

5249

53-
::: moniker range=">=vs-2019"
54-
5550
4. In the **Active rules** list, click **\<Browse>**.
5651

57-
::: moniker-end
5852

5953
5. In the **Open** dialog box, specify the check-in policy rule set file.
6054

docs/code-quality/implementing-custom-code-analysis-check-in-policies-for-managed-code.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,8 @@ You specify a project check-in policy rule set as the code analysis rule set of
110110
4. If necessary, click the appropriate options in the **Configuration** and **Platform** lists.
111111

112112

113-
::: moniker range=">=vs-2019"
114-
115113
5. To run code analysis every time that the code project is built using the specified configuration, select **Run on build** in the **Binary analyzers** section.
116114

117-
::: moniker-end
118115

119116
6. In the **Run this rule set** list, click **\<Browse>**.
120117

docs/code-quality/in-source-suppression-overview.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ ms.workload:
2424

2525
It is often useful to indicate that a warning is not applicable. Suppressing code analysis violations indicates team members the code was reviewed, and the warning can be suppressed. The following sections describe the different ways to suppress code analysis violations using the Visual Studio IDE.
2626

27-
::: moniker range=">=vs-2019"
2827

2928
## Suppress violations using the EditorConfig file
3029

3130
In an **EditorConfig file**, set the severity to `none`, for example, `dotnet_diagnostic.CA1822.severity = none`. To add an EditorConfig file, see [Add an EditorConfig file to a project](../ide/create-portable-custom-editor-options.md#add-and-remove-editorconfig-files).
3231

33-
::: moniker-end
3432

3533
## Suppress violations in source code
3634

@@ -42,13 +40,11 @@ You can suppress violations in code using a preprocessor directive, the [#pragma
4240

4341
If you choose **in Source**, you see a preview of the preprocessor directive that will be added to your code.
4442

45-
::: moniker range=">=vs-2019"
4643
:::image type="content" source="media/vs-2019/suppress-diagnostic-from-editor.png" alt-text="Suppress diagnostic from quick actions menu":::
4744

4845
If you choose **in Source (attribute)**, you see a preview of the [SuppressMessage attribute](#in-source-suppression-and-the-suppressmessage-attribute) that will be added to your code.
4946

5047
:::image type="content" source="media/vs-2019/suppress-diagnostic-from-editor-attribute.png" alt-text="Suppress diagnostic from quick actions menu using attribute":::
51-
::: moniker-end
5248

5349
- From the **Error List**
5450

@@ -75,11 +71,9 @@ The [global suppression file](#global-level-suppressions) uses the [SuppressMess
7571

7672
- From the **code editor**, place the cursor in the line of code with the violation and press **Quick actions and refactorings** (or press **Ctrl**+**Period (.)**) to open the **Quick Actions** menu. Select **Suppress CAXXXX**, and then choose **in Suppression File**. You see a preview of the [global suppression file](#global-level-suppressions) that will be created or modified.
7773

78-
::: moniker range=">=vs-2019"
7974

8075
- From the **Analyze** menu, select **Analyze** > **Build and Suppress Active Issues** on the menu bar to suppress all current violations. Suppressing all current violations is sometimes referred to as "baselining".
8176

82-
::: moniker-end
8377

8478

8579
## Suppress violations using project settings
@@ -102,12 +96,9 @@ In C++/CLI, use the macros CA\_SUPPRESS\_MESSAGE or CA\_GLOBAL\_SUPPRESS_MESSAGE
10296
> You should not use in-source suppressions on release builds, to prevent shipping the in-source suppression metadata accidentally.
10397
10498

105-
::: moniker range=">=vs-2019"
106-
10799
> [!NOTE]
108100
> If you migrate a project to Visual Studio 2019, you might suddenly be faced with a large number of code analysis warnings. If you aren't ready to fix the warnings, you can suppress all of them by selecting **Analyze** > **Build and Suppress Active Issues**.
109101
110-
::: moniker-end
111102

112103
### SuppressMessage attribute
113104

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,13 @@ Visual Studio includes a core set of .NET Compiler Platform (*Roslyn*) analyzers
3737
## To install VSIX analyzers
3838

3939

40-
::: moniker range=">=vs-2019"
41-
4240
1. In Visual Studio, select **Extensions** > **Manage Extensions**.
4341

4442
The **Manage Extensions** dialog box opens.
4543

4644
> [!NOTE]
4745
> Alternatively, you can find and download the analyzer extension directly from [Visual Studio Marketplace](https://marketplace.visualstudio.com).
4846
49-
::: moniker-end
5047

5148
2. Expand **Online** in the left pane, and then select **Visual Studio Marketplace**.
5249

@@ -69,11 +66,8 @@ Visual Studio includes a core set of .NET Compiler Platform (*Roslyn*) analyzers
6966
8. Open Visual Studio again.
7067

7168

72-
::: moniker range=">=vs-2019"
73-
7469
If you want to check whether the extension is installed, select **Extensions** > **Manage Extensions**. In the **Manage Extensions** dialog box, select the **Installed** category on the left, and then search for the extension by name.
7570

76-
::: moniker-end
7771

7872
## Next steps
7973

docs/code-quality/static-code-analysis-for-managed-code-overview.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,9 @@ Public class MyClass
5656
For more information, see [Suppress warnings](../code-quality/in-source-suppression-overview.md).
5757

5858

59-
::: moniker range=">=vs-2019"
60-
6159
> [!NOTE]
6260
> If you migrate a project to Visual Studio 2019, you might suddenly be faced with a large number of code analysis warnings. If you aren't ready to fix the warnings, you can suppress all of them by choosing **Analyze** > **Build and Suppress Active Issues**.
6361
64-
::: moniker-end
6562

6663
## Run code analysis as part of check-in policy
6764

docs/code-quality/walkthrough-analyzing-managed-code-for-code-defects.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,10 @@ This article steps you through the process of using legacy analysis to analyze y
5959
3. Choose the **Code Analysis** tab.
6060

6161

62-
::: moniker range=">=vs-2019"
63-
6462
4. Make sure that **Run on build** is selected in the **Binary analyzers** section.
6563

6664
5. From the **Active rules** drop-down list, select **Microsoft All Rules**.
6765

68-
::: moniker-end
6966

7067
6. On the **File** menu, click **Save Selected Items**, and then close the properties pages.
7168

docs/containers/container-launch-settings.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ms.topic: reference
1313

1414
In the *Properties* folder in an ASP.NET Core project, you can find the launchSettings.json file, which contains settings that control how your web app is started on your development machine. For detailed information on how this file is used in ASP.NET development, see [Use multiple environments in ASP.NET Core](/aspnet/core/fundamentals/environments?view=aspnetcore-2.2&preserve-view=true). In *launchSettings.json*, the settings in the **Docker** section are related to how Visual Studio handles containerized apps.
1515

16-
::: moniker range=">=vs-2019"
1716

1817
```json
1918
"Docker": {
@@ -31,7 +30,6 @@ In the *Properties* folder in an ASP.NET Core project, you can find the launchSe
3130
}
3231
```
3332

34-
::: moniker-end
3533

3634
The commandName setting identifies that this section applies to Container Tools. The following table shows the properties that can be set in this section:
3735

docs/containers/container-tools-configure.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,17 @@ Using Visual Studio settings, you can control some aspects of how Visual Studio
1818
From the main menu, choose **Tools > Options**, and expand **Container Tools > Settings**. The container tools settings appear.
1919

2020

21-
::: moniker range=">=vs-2019"
22-
2321
Container Tools **General** settings:
2422

2523
![Visual Studio Container Tools options, showing: Install Docker Desktop if needed, and Trust ASP.NET Core SSL certificate.](./media/configure-container-tools/tools-options-1.png)
2624

2725
Container Tools **Single Project** and **Docker Compose** settings:
2826

2927
![Visual Studio Container Tools options, showing: Kill containers on project close, Pull required Docker images on project open, and Run containers on project open.](./media/configure-container-tools/tools-options-2.png)
30-
::: moniker-end
3128

32-
The following table might help you decide how to set these options.
3329

30+
The following table might help you decide how to set these options.
3431

35-
::: moniker range=">=vs-2019"
3632

3733
The following table describes **General** settings:
3834

@@ -65,7 +61,6 @@ The following table describes the **Containers** window settings:
6561
| Confirm before removing an image | Always | Controls whether you are prompted when removing an image. |
6662
| Confirm before running large number of images | Always | Controls whether you are prompted before starting containers from more than 10 images at a time. |
6763

68-
::: moniker-end
6964
> [!WARNING]
7065
> If the localhost SSL certificate is not trusted, and you check the box to suppress prompting, then HTTPS web requests might fail at run time in your app or service. In that case, uncheck the **Do not prompt** checkbox, run your project, and indicate trust at the prompt.
7166

0 commit comments

Comments
 (0)