Skip to content

Fix markdown issues #5730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 98 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
26217d2
Create markdownlint.yml
Youssef1313 Aug 13, 2020
362752b
Create markdownlint-problem-matcher.json
Youssef1313 Aug 13, 2020
fa62c4a
Update ca1031.md
Youssef1313 Aug 13, 2020
20d3cd3
Update ca1062.md
Youssef1313 Aug 13, 2020
1d209cd
Update ca1507.md
Youssef1313 Aug 13, 2020
11783ca
Update ca1509.md
Youssef1313 Aug 13, 2020
dffbdd1
Update ca1826.md
Youssef1313 Aug 13, 2020
667d06c
Update ca1827.md
Youssef1313 Aug 13, 2020
a73338c
Update ca1828.md
Youssef1313 Aug 13, 2020
ea680c0
Update ca1829.md
Youssef1313 Aug 13, 2020
bb1ab2f
Update ca1833.md
Youssef1313 Aug 13, 2020
49ce3f7
Update ca1835.md
Youssef1313 Aug 13, 2020
f2acf07
Update ca1836.md
Youssef1313 Aug 13, 2020
2dc7649
Update ca2000.md
Youssef1313 Aug 13, 2020
c5f297d
Update ca2009.md
Youssef1313 Aug 13, 2020
4a5bb23
Update ca2013.md
Youssef1313 Aug 13, 2020
879e2ea
Update ca2015.md
Youssef1313 Aug 13, 2020
eb45153
Update ca2016.md
Youssef1313 Aug 13, 2020
2b82532
Update ca2100.md
Youssef1313 Aug 13, 2020
d797d76
Update ca2208.md
Youssef1313 Aug 13, 2020
4a0ecda
Update ca2225.md
Youssef1313 Aug 13, 2020
2969e58
Update ca2241.md
Youssef1313 Aug 13, 2020
c24f2bb
Update ca2244.md
Youssef1313 Aug 13, 2020
45d2295
Update ca2247.md
Youssef1313 Aug 13, 2020
91cc878
Update ca2247.md
Youssef1313 Aug 13, 2020
5883821
Update ca2301.md
Youssef1313 Aug 13, 2020
2613870
Update ca2301.md
Youssef1313 Aug 13, 2020
39a6f2e
Update ca2302.md
Youssef1313 Aug 13, 2020
ed11d46
Update ca2311.md
Youssef1313 Aug 13, 2020
a73c0c1
Update ca2312.md
Youssef1313 Aug 13, 2020
6c68ba6
Update ca2321.md
Youssef1313 Aug 13, 2020
25c0be5
Update ca2322.md
Youssef1313 Aug 13, 2020
c627e72
Update ca2327.md
Youssef1313 Aug 13, 2020
cdd6241
Update ca2328.md
Youssef1313 Aug 13, 2020
e930b1a
Update ca2329.md
Youssef1313 Aug 13, 2020
6af07b0
Update ca2330.md
Youssef1313 Aug 13, 2020
417f06f
Update ca3001.md
Youssef1313 Aug 13, 2020
64d6664
Update ca3002.md
Youssef1313 Aug 13, 2020
9e495b6
Update ca3003.md
Youssef1313 Aug 13, 2020
d673fc7
Update ca3004.md
Youssef1313 Aug 13, 2020
01dbd75
Update ca3005.md
Youssef1313 Aug 13, 2020
518fdb0
Update ca3006.md
Youssef1313 Aug 13, 2020
40c121f
Update ca3007.md
Youssef1313 Aug 13, 2020
c536989
Update ca3008.md
Youssef1313 Aug 13, 2020
f053c89
Update ca3010.md
Youssef1313 Aug 13, 2020
cd5ad93
Update ca3011.md
Youssef1313 Aug 13, 2020
9fcde97
Update ca3012.md
Youssef1313 Aug 13, 2020
5ce98c0
Update ca5361.md
Youssef1313 Aug 13, 2020
4c97591
Update ca5376.md
Youssef1313 Aug 13, 2020
c3032ac
Update ca5377.md
Youssef1313 Aug 13, 2020
532db23
Update ca5378.md
Youssef1313 Aug 13, 2020
2276dce
Update ca5380.md
Youssef1313 Aug 13, 2020
45c8195
Update ca5381.md
Youssef1313 Aug 13, 2020
b6279d5
Update ca5382.md
Youssef1313 Aug 13, 2020
52e1cf3
Update ca5383.md
Youssef1313 Aug 13, 2020
2c5b85a
Update ca5387.md
Youssef1313 Aug 13, 2020
f61c677
Update ca5388.md
Youssef1313 Aug 13, 2020
12cd26e
Update ca5389.md
Youssef1313 Aug 13, 2020
ae44a70
Update ca5390.md
Youssef1313 Aug 13, 2020
9482e16
Update ca5391.md
Youssef1313 Aug 13, 2020
b56f30a
Update ca5399.md
Youssef1313 Aug 13, 2020
e425ff9
Update ca5400.md
Youssef1313 Aug 13, 2020
82c91cf
Update code-analysis-for-managed-code-overview.md
Youssef1313 Aug 13, 2020
7031754
Update configure-live-code-analysis-scope-managed-code.md
Youssef1313 Aug 13, 2020
404eb24
Update fxcop-analyzer-options.md
Youssef1313 Aug 13, 2020
966e6ec
Update how-to-generate-code-metrics-data.md
Youssef1313 Aug 13, 2020
eba35d2
Update how-to-run-legacy-code-analysis-manually-for-managed-code.md
Youssef1313 Aug 13, 2020
ea07282
Update msbuild-targets.md
Youssef1313 Aug 13, 2020
1489cef
Update assign-github.md
Youssef1313 Aug 13, 2020
d179df1
Update assign-github.md
Youssef1313 Aug 13, 2020
ca1444d
Update uninstall.md
Youssef1313 Aug 13, 2020
42a6bee
Update understanding-performance-collection-methods.md
Youssef1313 Aug 13, 2020
7a4d634
Update dotnet-alloc-tool.md
Youssef1313 Aug 13, 2020
a423fbf
Update how-to-increase-chances-of-performance-issue-being-fixed.md
Youssef1313 Aug 13, 2020
d2d5ea3
Update select-code-type-dialog-box.md
Youssef1313 Aug 13, 2020
e123ee6
Update ca3009.md
Youssef1313 Aug 13, 2020
9bfb471
Update getting-started-with-visual-studio-tools-for-unity.md
Youssef1313 Aug 13, 2020
d8fe0c8
Update attach-to-running-processes-with-the-visual-studio-debugger.md
Youssef1313 Aug 13, 2020
96808b5
Update troubleshoot-data-breakpoint-errors.md
Youssef1313 Aug 13, 2020
40b8226
Update quickstart-deploy-to-azure.md
Youssef1313 Aug 13, 2020
dd2a2bb
NEED REVIEW ON THIS COMMIT..
Youssef1313 Aug 13, 2020
e716409
Update tutorial-editor.md
Youssef1313 Aug 13, 2020
76daeea
Update tutorial-uwp.md
Youssef1313 Aug 13, 2020
ed0901d
Update create-csharp-winform-visual-studio.md
Youssef1313 Aug 13, 2020
09861fa
Update create-custom-views-of-native-objects.md
Youssef1313 Aug 13, 2020
4b3f587
Update crt-debug-heap-details.md
Youssef1313 Aug 13, 2020
3b6a6d7
Update visual-studio-enterprise-guide.md
Youssef1313 Aug 13, 2020
a8b70c2
Update compile-typescript-code-npm.md
Youssef1313 Aug 13, 2020
e8420e4
Update msbuild-items.md
Youssef1313 Aug 13, 2020
ed7824c
Update rmarkdown-with-r-in-visual-studio.md
Youssef1313 Aug 13, 2020
0f7d170
Update installation.md
Youssef1313 Aug 13, 2020
71f3c38
Update keyboard-shortcuts.md
Youssef1313 Aug 13, 2020
98373b0
Update launch-settings.md
Youssef1313 Aug 13, 2020
3b8b65e
Update razor.md
Youssef1313 Aug 13, 2020
d6ece2b
Update container-launch-settings.md
Youssef1313 Aug 13, 2020
99d5fe3
Update container-tools-react.md
Youssef1313 Aug 13, 2020
20101db
Delete markdownlint-problem-matcher.json
Youssef1313 Aug 14, 2020
cdd289b
Delete markdownlint.yml
Youssef1313 Aug 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/code-quality/ca1031.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ dotnet_code_quality.CA1031.disallowed_symbol_names = NullReferenceException
```

Allowed type name formats in the option value (separated by '|'):
- Type name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format) with a `T:` prefix.
- Type name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format) with a `T:` prefix.

Examples:

Expand Down
10 changes: 5 additions & 5 deletions docs/code-quality/ca1062.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ dotnet_code_quality.CA1062.null_check_validation_methods = Validate
```

Allowed method name formats in the option value (separated by '|'):
- Method name only (includes all methods with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format), with an optional `M:` prefix.
- Method name only (includes all methods with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format), with an optional `M:` prefix.

Examples:

Expand All @@ -91,9 +91,9 @@ dotnet_code_quality.CA1062.excluded_symbol_names = MyType
```

Allowed symbol name formats in the option value (separated by '|'):
- Symbol name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format). Each symbol name requires a symbol kind prefix, such as "M:" prefix for methods, "T:" prefix for types, "N:" prefix for namespaces, etc.
- `.ctor` for constructors and `.cctor` for static constructors
- Symbol name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format). Each symbol name requires a symbol kind prefix, such as "M:" prefix for methods, "T:" prefix for types, "N:" prefix for namespaces, etc.
- `.ctor` for constructors and `.cctor` for static constructors

Examples:

Expand Down
2 changes: 0 additions & 2 deletions docs/code-quality/ca1507.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Rule CA1507 flags the use of a `string` literal as an argument to a method or co

- The declared name of the parameter is `propertyName` and the constant value of the `string` literal matches the name of a property of the type within which the method or constructor is being invoked.



Rule CA1507 improves code maintainability in cases where the parameter may be renamed in the future, but the `string` literal is mistakenly not renamed. By using `nameof`, the symbol will be renamed when the parameter is renamed through a refactoring operation. In addition, any spelling mistakes in the name of the parameter are caught by the compiler.

> [!NOTE]
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/ca1509.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ An invalid entry in this configuration file is flagged with the `CA1509` diagnos
> [!NOTE]
> Rule CA1509 is not available in legacy analysis. It was first introduced in [FxCop analyzers](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers) version 2.9.6.


## How to fix violations

To fix a violation of this rule, make sure the invalid entry in `CodeMetricsConfig.txt` gets the required format.
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/ca1826.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class C
}
```


```csharp
using System;
using System.Collections.Generic;
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/ca1827.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class C
}
```


```csharp
using System.Collections.Generic;
using System.Linq;
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/ca1828.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class C
}
```


```csharp
using System.Linq;
using System.Threading.Tasks;
Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/ca1829.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class C
}
```


```csharp
using System.Collections.Generic;

Expand Down
8 changes: 4 additions & 4 deletions docs/code-quality/ca1833.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class C
{
// The violation occurs for both statements below
Span<byte> tmp2 = arr[0..5];
Memory<byte> tmp4 = arr[5..10];
Memory<byte> tmp4 = arr[5..10];
...
}
}
Expand All @@ -66,7 +66,7 @@ class C
{
// The violations fixed with AsSpan or AsMemory accordingly
Span<byte> tmp2 = arr.AsSpan()[0..5];
Memory<byte> tmp4 = arr.AsMemory()[5..10];
Memory<byte> tmp4 = arr.AsMemory()[5..10];
...
}
}
Expand All @@ -88,8 +88,8 @@ class C
{
// The violation occurs
Span<byte> tmp1 = arr[0..5];
Memory<byte> tmp2 = arr[5..10];
...
Memory<byte> tmp2 = arr[5..10];
...
}
}
```
Expand Down
13 changes: 12 additions & 1 deletion docs/code-quality/ca1835.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The rule can detect a variety of violations for the `ReadAsync` and `WriteAsync`
##### Example 1

Invocations of `ReadAsync`, without and with a `CancellationToken` argument:

```cs
using System;
using System.IO;
Expand All @@ -82,7 +83,9 @@ class MyClass
}
}
```

##### Fix

```cs
using System;
using System.IO;
Expand All @@ -105,6 +108,7 @@ class MyClass
##### Example 2

Invocations of `WriteAsync`, without and with a `CancellationToken` argument:

```cs
using System;
using System.IO;
Expand All @@ -123,7 +127,9 @@ class MyClass
}
}
```

##### Fix

```cs
using System;
using System.IO;
Expand Down Expand Up @@ -167,7 +173,9 @@ class MyClass
}
}
```

##### Fix

```cs
using System;
using System.IO;
Expand Down Expand Up @@ -196,6 +204,7 @@ Here are some examples of invocations where the rule will **not** be fired:
##### Example 1

The return value is saved in a `Task` variable instead of being awaited:

```cs
using System;
using System.IO;
Expand All @@ -218,6 +227,7 @@ class MyClass
##### Example 2

The return value is returned by the wrapping method instead of being awaited:

```cs
using System;
using System.IO;
Expand All @@ -236,6 +246,7 @@ class MyClass
##### Example 3

The return value is used to call `ContinueWith`, which is the method being awaited:

```cs
using System;
using System.IO;
Expand All @@ -261,4 +272,4 @@ It's safe to suppress a violation of this rule if you're not concerned about imp

## See also

- [Performance warnings](../code-quality/performance-warnings.md)
- [Performance warnings](../code-quality/performance-warnings.md)
1 change: 0 additions & 1 deletion docs/code-quality/ca1836.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class C
}
```


```csharp
using System.Collections.Concurrent;

Expand Down
6 changes: 3 additions & 3 deletions docs/code-quality/ca2000.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ dotnet_code_quality.CA2000.excluded_symbol_names = MyType
```

Allowed symbol name formats in the option value (separated by '|'):
- Symbol name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format). Each symbol name requires a symbol kind prefix, such as "M:" prefix for methods, "T:" prefix for types, "N:" prefix for namespaces, etc.
- `.ctor` for constructors and `.cctor` for static constructors
- Symbol name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format). Each symbol name requires a symbol kind prefix, such as "M:" prefix for methods, "T:" prefix for types, "N:" prefix for namespaces, etc.
- `.ctor` for constructors and `.cctor` for static constructors

Examples:

Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/ca2009.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public class C
}
```


```csharp
using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions docs/code-quality/ca2013.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ To fix the violation, replace it with a more appropriate equality check such as
```csharp

int int1 = 1, int2 = 1;

// Violation occurs, returns false.
Console.WriteLine(Object.ReferenceEquals(int1, int2)); // false

// Use appropriate equality operator or method instead
Console.WriteLine(int1 == int2); // true
Console.WriteLine(Object.Equals(int1, int2)); // true
Expand Down
4 changes: 2 additions & 2 deletions docs/code-quality/ca2015.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class DerivedClass <T> : MemoryManager<T>
_handle.Dispose();
}
}

...

// Violation occurs, remove the finalizer to fix the warning.
~DerivedClass() => Dispose(false);
}
Expand Down
7 changes: 6 additions & 1 deletion docs/code-quality/ca2016.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ namespace ConsoleApp
##### Fix

Forward the `c` parameter:

```csharp
public static void MyMethod(CancellationToken c)
{
Expand All @@ -86,6 +87,7 @@ Forward the `c` parameter:
If you are not concerned about forwarding cancellation notifications to lower invocations, you can either:

Explicitly pass `default`:

```csharp
public static void MyMethod(CancellationToken c)
{
Expand All @@ -94,6 +96,7 @@ Explicitly pass `default`:
```

Or explicitly pass `CancellationToken.None`:

```csharp
public static void MyMethod(CancellationToken c)
{
Expand Down Expand Up @@ -131,6 +134,7 @@ namespace ConsoleApp
##### Fix

Forward the `c` parameter:

```csharp
public static void MyMethod(CancellationToken c)
{
Expand All @@ -141,6 +145,7 @@ Forward the `c` parameter:
If you are not concerned about forwarding cancellation notifications to lower invocations, you can either:

Explicitly pass `default`:

```csharp
public static void MyMethod(CancellationToken c)
{
Expand All @@ -149,14 +154,14 @@ Explicitly pass `default`:
```

Or explicitly pass `CancellationToken.None`:

```csharp
public static void MyMethod(CancellationToken c)
{
MyMethodWithOverload(CancellationToken.None);
}
```


#### No diagnosis

##### Example 1
Expand Down
6 changes: 3 additions & 3 deletions docs/code-quality/ca2100.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ dotnet_code_quality.CA2100.excluded_symbol_names = MyType
```

Allowed symbol name formats in the option value (separated by '|'):
- Symbol name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format). Each symbol name requires a symbol kind prefix, such as "M:" prefix for methods, "T:" prefix for types, "N:" prefix for namespaces, etc.
- `.ctor` for constructors and `.cctor` for static constructors
- Symbol name only (includes all symbols with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format). Each symbol name requires a symbol kind prefix, such as "M:" prefix for methods, "T:" prefix for types, "N:" prefix for namespaces, etc.
- `.ctor` for constructors and `.cctor` for static constructors

Examples:

Expand Down
1 change: 1 addition & 0 deletions docs/code-quality/ca2208.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (
```ini
dotnet_code_quality.ca2208.api_surface = public
```

By default CA2208 rules apply for all API surface (public, internal and private). 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).

## Example
Expand Down
6 changes: 3 additions & 3 deletions docs/code-quality/ca2225.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ This rule examines:
|!|N/A|!|LogicalNot|
|%|Mod|%|Mod or Remainder|
|%=|N/A|%=|Mod|
|* (binary)|*|*|Multiply|
|*=|N/A|*=|Multiply|
|\* (binary)|\*|\*|Multiply|
|\*=|N/A|\*=|Multiply|
|~|Not|~|OnesComplement|
|>>|>>|>>|RightShift|
=|N/A|>>=|RightShift|
Expand All @@ -78,7 +78,7 @@ This rule examines:
|+ (unary)|N/A|+|Plus|
|false|IsFalse|False|IsTrue (Property)|

*N/A means the operator cannot be overloaded in the selected language.
\*N/A means the operator cannot be overloaded in the selected language.

> [!NOTE]
> In C#, when a binary operator is overloaded, the corresponding assignment operator, if any, is also implicitly overloaded.
Expand Down
4 changes: 2 additions & 2 deletions docs/code-quality/ca2241.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ dotnet_code_quality.CA2241.additional_string_formatting_methods = MyFormat
```

Allowed method name formats in the option value (separated by '|'):
- Method name only (includes all methods with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format), with an optional `M:` prefix.
- Method name only (includes all methods with the name, regardless of the containing type or namespace)
- Fully qualified names in the symbol's [documentation ID format](https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format), with an optional `M:` prefix.

Examples:

Expand Down
1 change: 0 additions & 1 deletion docs/code-quality/ca2244.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class C
>
> ![Code fix for CA2244 - Remove redundant element initializer](media/ca2244-codefix.png)


## When to suppress warnings

Do not suppress violations for this rule.
Expand Down
3 changes: 1 addition & 2 deletions docs/code-quality/ca2247.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ To fix the violation, replace the <xref:System.Threading.Tasks.TaskContinuationO
```csharp
// Violation
var tcs = new TaskCompletionSource<int>(TaskContinuationOptions.RunContinuationsAsynchronously);

// Fixed
var tcs = new TaskCompletionSource<int>(TaskCreationOptions.RunContinuationsAsynchronously);
```
Expand All @@ -47,7 +47,6 @@ To fix the violation, replace the <xref:System.Threading.Tasks.TaskContinuationO

A violation of this rule almost always highlights a bug in the calling code, such that the code will not behave as the developer intended, with the TaskCompletionSource effectively ignoring the specified option. The only time it is safe to suppress the warning is if the developer actually intended to pass a boxed <xref:System.Threading.Tasks.TaskContinuationOptions?displayProperty=fullName> as the object state argument to the TaskCompletionSource.


## See also

- [Usage warnings](../code-quality/usage-warnings.md)
Loading