Creating a custom rule in FxCop

2019-01-12 01:26发布

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!

3条回答
2楼-- · 2019-01-12 01:50

This tutorial seems really comprehensive.

查看更多
虎瘦雄心在
3楼-- · 2019-01-12 01:50

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

查看更多
一夜七次
4楼-- · 2019-01-12 02:10

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

查看更多
登录 后发表回答