Cannot start code analyzer in Visual Studio 2015

I installed Microsoft.CodeAnalysis.CSharp.FxCopAnalyzers from nuget in the project.

enter image description here

The project in which it is installed is an existing project created against Framework 4.5.1.

Code analysis is included in the project ...

enter image description here

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

However, I don’t see how I see what is visible from the analyzer, and I can’t find what this icon means in the documentation:

Analyzers

Right-click on the node Analyzers and select Open Active Rule Set . I can see the CA rules that the FxCop analyzer should use:

Active ruleset

Checking the location of the DLL, it is in the nuget folder, as expected:

enter image description here

+7
visual-studio-2015 code-analysis roslyn fxcop analyzer
source share
2 answers

This package has not been updated since January. I guess it was replaced by

Microsoft.CodeAnalysis.FxCopAnalyzers

+2
source share

You can right-click on the Analyzers node and select the Open Active Rule Set to view all the analyzers included in your project. You can then modify this list and it will save these changes to your project. If the analyzer does not work, it may not be included in your project.

If the anlayzer dll file is missing, you can add it from the Analyzer node context menu or via nuget packages (depending on where it comes from).

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

+2
source share

All Articles