All our developers are using VS2010 professional so code analysis is not available. I want them to use FxCop to analyze the code before checking in. I have gone through the rules and disabled a bunch of them and added couple of them. I want all the developers to use same set of rules since it will be the rules used in MSBuild. How do I distribute the rule set to be used in FxCop? What files need to be distributed and where is it supposed to go to?
2 Answers
An alternative or a good complement to FxCop would be to use the commercial tool NDepend. With this tool one can write Code Rule over LINQ Queries (namely CQLinq). Disclaimer: I am one of the developers of the tool
More than 200 code rules are proposed by default, these include design, architecture, code quality, code evolution, naming conventions, dead code, .NET Fx usage...
CQLinq is dedicated to write code rules that can be verified live in Visual Studio, or that can be verified during build process and reported in an HTML/javascript report.
The strength of CQLinq over FxCop, is that it is straightforward to write/customize/share a code rule, and get immediately results. Facilities are proposed to browse matched code elements. Concretely this looks like that:

- 13,237
- 6
- 61
- 92
-
1Without doubt it is easy to do with NDepeDoes NDepends come with default industry rules like FxCop? – Nair Oct 19 '10 at 18:16
-
1Yes, download NDepend trial and you'll see that NDepend comes with more than a hundred of default rules, and many trails queries to let the user define its custom rules or customize existing ones. – Patrick from NDepend team Oct 20 '10 at 09:30
-
Here is the list of 200 default rules provided by NDepend: http://www.ndepend.com/DefaultRules/webframe.html – Patrick from NDepend team Jun 22 '12 at 10:20
When using stand-alone FxCop, you can create an FxCop project file (with extension .fxcop) which contains the list rules that are to be used in the analysis. (Typically, the file will also include the list of target assemblies, although this is optional.) This file may be checked into source control with your code in order to distribute it to the developers working on the shared code base.

- 20,843
- 2
- 44
- 49
-
Is it possible to predefine the rules as in my case and then distribute it all the developers? – Nair Sep 23 '10 at 14:33
-
That's exactly what my previous answer explained how to do. Do you need more detailed help with some particular step(s)? If so, could you please indicate which? – Nicole Calinoiu Sep 23 '10 at 16:14