dotnet / dotnet/sdk

CA1416 doesn't work when Microsoft.CodeAnalysis.NetAnalyzers is referenced directly with EnableNETAnalyzers=false

Closed
#53,125 10 comments 2 reactions 0 assignees View on GitHub
Area-Microsoft.CodeAnalysis.NetAnalyzers Bug
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

When a project has a dependency on `Microsoft.CodeAnalysis.NetAnalyzers` `v10.0.103` and `EnableNETAnalyzers` is set to false, CA1416 warnings aren't being triggered when they should ([reproduction code](https://github.com/amaltinsky/CA1416Demo)).

This didn't use to be the case with `Microsoft.CodeAnalysis.NetAnalyzers` `v8.0.0`. In fact, adding a dependency on `Microsoft.CodeAnalysis.NetAnalyzers` `v8.0.0` used to set `EnableNETAnalyzers` to `false` to prevent collisions between the SDK's built-in analyzers and the package-provided ones.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.