7

I installed Microsoft.CodeAnalysis.CSharp.FxCopAnalyzers from nuget into a project.

enter image description here

The project it is installed into is an existing project, building against Framework 4.5.1.

Code Analysis is Enabled on the project...

enter image description here

... and I see CA warnings in the Build out put and the error window as expected, so I believe the ruleset to be valid.

However I can't seem to see out put from the analyzer, and I can't seem to find what this icon means in the documentation:

Analyzers

Right clicking on the Analyzers node and selecting Open Active Rule Set I can see the CA rules that the FxCop analyzer should be using:

Active Ruleset

Checking the location of the DLL, it's there in the nuget folder as expected:

enter image description here

NikolaiDante
  • 18,469
  • 14
  • 77
  • 117

2 Answers2

2

You can right click on the Analyzers node and select Open Active Rule Set to see all of the analyzers enabled on your project. You can then modify this list and it will save those changes back to your project. If an analyzer isn't firing, then maybe it isn't enabled in your project.

If there is an anlayzer DLL that is missing, you can add it from the Analyzer node right click menu or via nuget packages (depending on where it comes from).

I have a post on my blog with more information on using analyzers in your project: https://johnkoerner.com/csharp/using-analyzers-in-your-projects/

John Koerner
  • 37,428
  • 8
  • 84
  • 134
2

This package hasn't been updated since January. I guess it's been replaced by

Microsoft.CodeAnalysis.FxCopAnalyzers

wziska
  • 418
  • 1
  • 5
  • 15