Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get FxCop have the same set of rules as that of Visual Studio Code Analysis?

Yesterday I posted a question here ( FxCop and Code Analysis Rules ) about getting FxCop to run the same rules as Code Analysis and I thought it was resolved.

However it seems like there's no real way to get FxCop to run the same exact set of rules as Visual Studio 2010's Code Analysis. For instance once I got everything working with my FxCopCmd setup it started barking about rules denoted in the Minimum Recommended Rules ruleset like CA2000. If I remove the rules it doesn't like it runs the analysis and everything looks good . . . except it's really not running the same ruleset!

This seems kind of crazy to me! Is there anyway to get FxCop to analyze the exact same set of rules that Visual Studio Code Analysis can analyze against? Is there a .dll to add to the rules to analyze to get the rules like CA2000 and others?

like image 380
Hungry Beast Avatar asked Oct 23 '22 04:10

Hungry Beast


1 Answers

VS Code Analysis includes some rules that are not included with stand-alone FxCop. You will need to ensure that the extra rule assemblies are available to fxcopcmd.exe. The easiest way to do this is to replace the contents of your build-source FxCop folder with those from your Visual Studio installation since one of the rule assemblies (DataflowRules.dll) uses an analysis engine that isn't included with stand-alone FxCop either, and that depends on a bunch of other assemblies that are also included in the FxCop folder under the VS installation folder hierarchy.

like image 169
Nicole Calinoiu Avatar answered Nov 01 '22 09:11

Nicole Calinoiu