Creating a custom rule in FxCop

早过忘川 提交于 2019-12-17 12:37:19

问题


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!


回答1:


This tutorial seems really comprehensive.




回答2:


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




回答3:


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:



来源:https://stackoverflow.com/questions/366095/creating-a-custom-rule-in-fxcop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!