Question

I want to create extra rules in FXCop. Custom Rules to help ensure specific best practices like checking against inline sql.

I'm really looking for good resources and examples. Thanks!

Was it helpful?

Solution

This tutorial seems really comprehensive.

OTHER TIPS

The tutorial above is pretty good. I knocked together a sample VS project that also might be useful, since I couldn't find any example projects http://www.doogal.co.uk/files/FxCopRules.zip

You can also use the commercial tool NDepend to write your custom code rules over LINQ queries (CQLinq). Disclaimer: I am one of the developers of the tool

More than 200 code rules are proposed by default.

The strength of CQLinq over FxCop API or other tools, is that it is straightforward to write a code rule, and get immediately results. Facilities are proposed to browse matched code elements. For example:

CQLinq code rule

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top