Skip to content

Commit d3485be

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

File tree

265 files changed

+475
-1753
lines changed

Some content is hidden

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

265 files changed

+475
-1753
lines changed

docs/code-quality/analyzers-faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This page contains answers to some frequently asked questions about .NET Compile
1818

1919
**Q**: Should I use code analysis or EditorConfig for checking code style?
2020

21-
**A**: Code analysis and EditorConfig files work hand-in-hand. When you define code styles [in an EditorConfig file](../ide/editorconfig-code-style-settings-reference.md) or on the [text editor Options](../ide/code-styles-and-code-cleanup.md) page, you're actually configuring the code analyzers that are built into Visual Studio. EditorConfig files can be used to enable or disable analyzer rules, and also to configure some NuGet analyzer packages, such as [FxCop analyzers](configure-fxcop-analyzers.md).
21+
**A**: Code analysis and EditorConfig files work hand-in-hand. When you define code styles [in an EditorConfig file](../ide/editorconfig-code-style-settings-reference.md) or on the [text editor Options](../ide/code-styles-and-code-cleanup.md) page, you're actually configuring the code analyzers that are built into Visual Studio. EditorConfig files can be used to enable or disable analyzer rules, and also to configure NuGet analyzer packages.
2222

2323
## EditorConfig versus rule sets
2424

@@ -28,8 +28,8 @@ This page contains answers to some frequently asked questions about .NET Compile
2828

2929
However, EditorConfig files offer additional ways to configure rules too:
3030

31-
- For FxCop analyzers, EditorConfig files let you [define which types of code to analyze](fxcop-analyzer-options.md).
32-
- For the code-style analyzers that are built into Visual Studio, EditorConfig files let you [define the preferred code styles](../ide/editorconfig-code-style-settings-reference.md) for a codebase.
31+
- For the .NET code-quality analyzers, EditorConfig files let you [define which types of code to analyze](fxcop-analyzer-options.md).
32+
- For the .NET code-style analyzers that are built into Visual Studio, EditorConfig files let you [define the preferred code styles](../ide/editorconfig-code-style-settings-reference.md) for a codebase.
3333

3434
In addition to rule sets and EditorConfig files, some analyzers are configured through the use of text files marked as [additional files](../ide/build-actions.md#build-action-values) for the C# and VB compilers.
3535

docs/code-quality/ca1000.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ Do not suppress a warning from this rule. Providing generics in a syntax that is
6464

6565
## Configurability
6666

67-
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
67+
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
6868

6969
```ini
7070
dotnet_code_quality.ca1000.api_surface = private, internal
7171
```
7272

73-
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
73+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure .NET code-quality analyzers](configure-fxcop-analyzers.md).
7474

7575
## Related rules
7676

docs/code-quality/ca1001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ A class declares and implements an instance field that is a <xref:System.IDispos
3232
## Rule description
3333
A class implements the <xref:System.IDisposable> interface to dispose of unmanaged resources that it owns. An instance field that is an <xref:System.IDisposable> type indicates that the field owns an unmanaged resource. A class that declares an <xref:System.IDisposable> field indirectly owns an unmanaged resource and should implement the <xref:System.IDisposable> interface. If the class does not directly own any unmanaged resources, it should not implement a finalizer.
3434

35-
Starting with FxCop analyzers 3.x, this rule respects types implementing <xref:System.IAsyncDisposable?displayProperty=fullName> as disposable types.
35+
This rule respects types implementing <xref:System.IAsyncDisposable?displayProperty=fullName> as disposable types.
3636

3737
## How to fix violations
3838
To fix a violation of this rule, implement <xref:System.IDisposable> and from the <xref:System.IDisposable.Dispose%2A?displayProperty=fullName> method call the <xref:System.IDisposable.Dispose%2A> method of the field.

docs/code-quality/ca1003.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ Do not suppress a warning from this rule.
4848

4949
## Configurability
5050

51-
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
51+
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
5252

5353
```ini
5454
dotnet_code_quality.ca1003.api_surface = private, internal
5555
```
5656

57-
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
57+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure .NET code-quality analyzers](configure-fxcop-analyzers.md).
5858

5959
## Example
6060

docs/code-quality/ca1008.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ author: mikejo5000
1313
ms.author: mikejo
1414
manager: jillfra
1515
dev_langs:
16-
- CPP
1716
- CSharp
1817
- VB
1918
ms.workload:
@@ -49,19 +48,18 @@ Do not suppress a warning from this rule except for flags-attributed enumeration
4948

5049
## Configurability
5150

52-
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
51+
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
5352

5453
```ini
5554
dotnet_code_quality.ca1008.api_surface = private, internal
5655
```
5756

58-
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
57+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure .NET code-quality analyzers](configure-fxcop-analyzers.md).
5958

6059
## Example
6160

6261
The following example shows two enumerations that satisfy the rule and an enumeration, `BadTraceOptions`, that violates the rule.
6362

64-
[!code-cpp[FxCop.Design.EnumsZeroValue#1](../code-quality/codesnippet/CPP/ca1008-enums-should-have-zero-value_1.cpp)]
6563
[!code-csharp[FxCop.Design.EnumsZeroValue#1](../code-quality/codesnippet/CSharp/ca1008-enums-should-have-zero-value_1.cs)]
6664
[!code-vb[FxCop.Design.EnumsZeroValue#1](../code-quality/codesnippet/VisualBasic/ca1008-enums-should-have-zero-value_1.vb)]
6765

docs/code-quality/ca1009.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ author: mikejo5000
1313
ms.author: mikejo
1414
manager: jillfra
1515
dev_langs:
16-
- CPP
1716
- CSharp
1817
- VB
1918
ms.workload:
@@ -31,7 +30,7 @@ ms.workload:
3130
A delegate that handles a public or protected event does not have the correct signature, return type, or parameter names.
3231

3332
> [!NOTE]
34-
> This legacy rule is not available in FxCop Analyzers. For more information, see [Deprecated rules](fxcop-rule-port-status.md#deprecated-rules).
33+
> This rule has been deprecated. For more information, see [Deprecated rules](fxcop-rule-port-status.md#deprecated-rules).
3534
3635
## Rule description
3736
Event handler methods take two parameters. The first is of type <xref:System.Object?displayProperty=fullName> and is named 'sender'. This is the object that raised the event. The second parameter is of type <xref:System.EventArgs?displayProperty=fullName> and is named 'e'. This is the data that is associated with the event. For example, if the event is raised whenever a file is opened, the event data typically contains the name of the file.
@@ -47,7 +46,6 @@ Do not suppress a warning from this rule.
4746
## Example
4847
The following example shows a delegate that is suited to handling events. The methods that can be invoked by this event handler comply with the signature that is specified in the Design Guidelines. `AlarmEventHandler` is the type name of the delegate. `AlarmEventArgs` derives from the base class for event data, <xref:System.EventArgs>, and holds alarm event data.
4948

50-
[!code-cpp[FxCop.Design.EventsTwoParams#1](../code-quality/codesnippet/CPP/ca1009-declare-event-handlers-correctly_1.cpp)]
5149
[!code-csharp[FxCop.Design.EventsTwoParams#1](../code-quality/codesnippet/CSharp/ca1009-declare-event-handlers-correctly_1.cs)]
5250
[!code-vb[FxCop.Design.EventsTwoParams#1](../code-quality/codesnippet/VisualBasic/ca1009-declare-event-handlers-correctly_1.vb)]
5351

docs/code-quality/ca1010.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ It is safe to suppress a warning from this rule; however, the use of the collect
5151

5252
## Configurability
5353

54-
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
54+
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
5555

5656
```ini
5757
dotnet_code_quality.ca1010.api_surface = private, internal
5858
```
5959

60-
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
60+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure .NET code-quality analyzers](configure-fxcop-analyzers.md).
6161

6262
### Additional required generic interfaces
6363

docs/code-quality/ca1011.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ author: mikejo5000
1313
ms.author: mikejo
1414
manager: jillfra
1515
dev_langs:
16-
- CPP
1716
- CSharp
1817
- VB
1918
ms.workload:
@@ -56,7 +55,6 @@ In these cases, the code will be more robust because of the strong type checking
5655
The following example shows a method, `ManipulateFileStream`, that can be used only with a <xref:System.IO.FileStream> object, which violates this rule. A second method, `ManipulateAnyStream`, satisfies the rule by replacing the <xref:System.IO.FileStream> parameter by using a <xref:System.IO.Stream>.
5756

5857
[!code-csharp[FxCop.Design.ConsiderPassingBaseTypes#1](../code-quality/codesnippet/CSharp/ca1011-consider-passing-base-types-as-parameters_1.cs)]
59-
[!code-cpp[FxCop.Design.ConsiderPassingBaseTypes#1](../code-quality/codesnippet/CPP/ca1011-consider-passing-base-types-as-parameters_1.cpp)]
6058
[!code-vb[FxCop.Design.ConsiderPassingBaseTypes#1](../code-quality/codesnippet/VisualBasic/ca1011-consider-passing-base-types-as-parameters_1.vb)]
6159

6260
## Related rules

docs/code-quality/ca1012.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ Do not suppress a warning from this rule. The abstract type has a public constru
4545

4646
## Configurability
4747

48-
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
48+
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
4949

5050
```ini
5151
dotnet_code_quality.ca1012.api_surface = private, internal
5252
```
5353

54-
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
54+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure .NET code-quality analyzers](configure-fxcop-analyzers.md).
5555

5656
## Example
5757

docs/code-quality/ca1014.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ author: mikejo5000
1313
ms.author: mikejo
1414
manager: jillfra
1515
dev_langs:
16-
- CPP
1716
- CSharp
1817
- VB
1918
ms.workload:
@@ -45,7 +44,6 @@ Do not suppress a warning from this rule. If you do not want the assembly to be
4544
The following example shows an assembly that has the <xref:System.CLSCompliantAttribute?displayProperty=fullName> attribute applied that declares it CLS-compliant.
4645

4746
[!code-csharp[FxCop.Design.AssembliesCls#1](../code-quality/codesnippet/CSharp/ca1014-mark-assemblies-with-clscompliantattribute_1.cs)]
48-
[!code-cpp[FxCop.Design.AssembliesCls#1](../code-quality/codesnippet/CPP/ca1014-mark-assemblies-with-clscompliantattribute_1.cpp)]
4947
[!code-vb[FxCop.Design.AssembliesCls#1](../code-quality/codesnippet/VisualBasic/ca1014-mark-assemblies-with-clscompliantattribute_1.vb)]
5048

5149
## See also

docs/code-quality/ca1016.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ author: mikejo5000
1313
ms.author: mikejo
1414
manager: jillfra
1515
dev_langs:
16-
- CPP
1716
- CSharp
1817
- VB
1918
ms.workload:
@@ -59,7 +58,6 @@ The following example shows an assembly that has the <xref:System.Reflection.Ass
5958

6059
[!code-csharp[FxCop.Design.AssembliesVersion#1](../code-quality/codesnippet/CSharp/ca1016-mark-assemblies-with-assemblyversionattribute_1.cs)]
6160
[!code-vb[FxCop.Design.AssembliesVersion#1](../code-quality/codesnippet/VisualBasic/ca1016-mark-assemblies-with-assemblyversionattribute_1.vb)]
62-
[!code-cpp[FxCop.Design.AssembliesVersion#1](../code-quality/codesnippet/CPP/ca1016-mark-assemblies-with-assemblyversionattribute_1.cpp)]
6361

6462
## See also
6563

docs/code-quality/ca1017.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ author: mikejo5000
1313
ms.author: mikejo
1414
manager: jillfra
1515
dev_langs:
16-
- CPP
1716
- CSharp
1817
- VB
1918
ms.workload:
@@ -42,7 +41,6 @@ Do not suppress a warning from this rule. If you want the assembly to be visible
4241
## Example
4342
The following example shows an assembly that has the <xref:System.Runtime.InteropServices.ComVisibleAttribute> attribute applied to prevent it from being visible to COM clients.
4443

45-
[!code-cpp[FxCop.Design.AssembliesCom#1](../code-quality/codesnippet/CPP/ca1017-mark-assemblies-with-comvisibleattribute_1.cpp)]
4644
[!code-vb[FxCop.Design.AssembliesCom#1](../code-quality/codesnippet/VisualBasic/ca1017-mark-assemblies-with-comvisibleattribute_1.vb)]
4745
[!code-csharp[FxCop.Design.AssembliesCom#1](../code-quality/codesnippet/CSharp/ca1017-mark-assemblies-with-comvisibleattribute_1.cs)]
4846

docs/code-quality/ca1020.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ms.workload:
2828
A namespace other than the global namespace contains fewer than five types.
2929

3030
> [!NOTE]
31-
> This legacy rule is not available in FxCop Analyzers. For more information, see [Deprecated rules](fxcop-rule-port-status.md#deprecated-rules).
31+
> This rule has been deprecated. For more information, see [Deprecated rules](fxcop-rule-port-status.md#deprecated-rules).
3232
3333
## Rule description
3434

docs/code-quality/ca1021.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ It is safe to suppress a warning from this rule. However, this design could caus
4747

4848
## Configurability
4949

50-
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
50+
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
5151

5252
```ini
5353
dotnet_code_quality.ca1021.api_surface = private, internal
5454
```
5555

56-
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
56+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure .NET code-quality analyzers](configure-fxcop-analyzers.md).
5757

5858
## Example
5959
The following library shows two implementations of a class that generates responses to the feedback of a user. The first implementation (`BadRefAndOut`) forces the library user to manage three return values. The second implementation (`RedesignedRefAndOut`) simplifies the user experience by returning an instance of a container class (`ReplyData`) that manages the data as a single unit.

docs/code-quality/ca1023.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ author: mikejo5000
1313
ms.author: mikejo
1414
manager: jillfra
1515
dev_langs:
16-
- CPP
1716
- CSharp
1817
- VB
1918
ms.workload:
@@ -43,7 +42,6 @@ Suppress a warning from this rule only after carefully considering the need for
4342
The following example shows a type, `DayOfWeek03`, with a multi-dimensional indexer that violates the rule. The indexer can be seen as a type of conversion and therefore is more appropriately exposed as a method. The type is redesigned in `RedesignedDayOfWeek03` to satisfy the rule.
4443

4544
[!code-vb[FxCop.Design.OneDimensionForIndexer#1](../code-quality/codesnippet/VisualBasic/ca1023-indexers-should-not-be-multidimensional_1.vb)]
46-
[!code-cpp[FxCop.Design.OneDimensionForIndexer#1](../code-quality/codesnippet/CPP/ca1023-indexers-should-not-be-multidimensional_1.cpp)]
4745
[!code-csharp[FxCop.Design.OneDimensionForIndexer#1](../code-quality/codesnippet/CSharp/ca1023-indexers-should-not-be-multidimensional_1.cs)]
4846

4947
## Related rules

docs/code-quality/ca1024.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ Suppress a warning from this rule if the method meets at least one of the previo
6666

6767
## Configurability
6868

69-
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
69+
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
7070

7171
```ini
7272
dotnet_code_quality.ca1024.api_surface = private, internal
7373
```
7474

75-
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
75+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure .NET code-quality analyzers](configure-fxcop-analyzers.md).
7676

7777
## Control property expansion in the debugger
7878

0 commit comments

Comments
 (0)