Flynn1179
Flynn1179

Reputation: 12075

Why are all the analyzers on a new .NET5 project suppressed?

I just updated a project to use .NET5 on the latest VS2019, and given that the .NET analyzers are now part of .NET5, I reverted to using those.. except they're all suppressed. The CA1062 rule for example, is listed as having a severity of 'Warning', but an 'Effective Severity' of 'Suppressed', and I can't find any way of getting it to work.

I don't have an editor config or anything like that, even on a brand new project it does the same. I've searched as much as I can, but I can't find anywhere that might give me some clue as to why this is happening.

Anybody got any ideas?

Upvotes: 1

Views: 500

Answers (1)

Gavin Brown
Gavin Brown

Reputation: 56

try setting

    <AnalysisMode>AllEnabledByDefault</AnalysisMode>

in your .csproj file. See AnalysisMode

Upvotes: 4

Related Questions