How to share FxCop rules among all developers?

All our developers use VS2010 professional, so code analysis is not available. I want them to use FxCop for code analysis before validation. I went through the rules and disabled them and added a couple of them. I want all developers to use the same set of rules, as these will be the rules used in MSBuild. How to distribute the ruleset to be used in FxCop? What files need to be distributed and where should it go?

+6
fxcop
source share
2 answers

When using stand-alone FxCop, you can create an FxCop project file (with the extension .fxcop) that contains the list rules that will be used in the analysis. (Typically, the file will also contain a list of target assemblies, although this is not necessary.) This file can be checked in the source element with your code to distribute it to developers working on the basis of common code.

+2
source share

An alternative or a good addition to FxCop would be to use the commercial NDepend tool. Using this tool, you can write a code rule over LINQ queries (namely, CQLinq) . Disclaimer: I am one of the developers of this tool

By default, more than 200 code rules are offered, including design, architecture, code quality, code evolution, naming conventions, error code, Using .NET Fx ...

CQLinq is designed to write code rules that can be checked live in Visual Studio or can be checked during the build process and reported in the HTML / javascript report .

The power of CQLinq over FxCop is that it is easy to write / configure / share a code rule and get immediate results. Tools are provided for viewing consistent code elements. Specifically, it looks like this:

CQLinq code rule

+3
source share

All Articles