vs-threading icon indicating copy to clipboard operation
vs-threading copied to clipboard

Disable VSTHRD103 if CA1849 exists

Open cremor opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

VSTHRD103 and CA1849 seem to be duplicates. But CA1849 seems to be better. For example, VSTHRD103 is missing the fix from dotnet/roslyn-analyzers#6858

Describe the solution you'd like

VSTHRD103 should be disabled in SDKs that contain CA1849.

Describe alternatives you've considered

Manually disabling VSTHRD103 in each project, which is annoying.

Additional context

There might be other analyzers which are duplicates. All should be disabled if they already exist in the SDK.

cremor avatar May 16 '24 13:05 cremor

I don't think analyzers have insight into what SDK the compiler runs from. We'd also not want to turn off VSTHRD103 automatically just because CA1849 exists, since CA1849 is off by default when VSTHRD103 is on by default. Turning VSTHRD103 off when CA1849 is both present and on would likely be reasonable. If we can identify how to determine that, then this request is actionable.

Until then, the user may choose to disable VSTHRD103 when they enable CA1849.

AArnott avatar May 17 '24 14:05 AArnott