简体   繁体   English

在FxCop中创建自定义规则

[英]Creating a custom rule in FxCop

I want to create extra rules in FXCop. 我想在FXCop中创建额外的规则。 Custom Rules to help ensure specific best practices like checking against inline sql. 自定义规则,以帮助确保特定的最佳实践,如检查内联sql。

I'm really looking for good resources and examples. 我真的在寻找好的资源和例子。 Thanks! 谢谢!

本教程看起来非常全面。

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 我把一个可能有用的样本VS项目拼凑在一起,因为我找不到任何示例项目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) . 您还可以使用商业工具NDepend 在LINQ查询(CQLinq)上编写自定义代码规则 Disclaimer: I am one of the developers of the tool 免责声明:我是该工具的开发人员之一

More than 200 code rules are proposed by default. 默认情况下,提出了200多个代码规则

The strength of CQLinq over FxCop API or other tools, is that it is straightforward to write a code rule , and get immediately results. 与FxCop API或其他工具相比,CQLinq的优势在于可以直接编写代码规则立即获得结果。 Facilities are proposed to browse matched code elements. 建议设施浏览匹配的代码元素。 For example: 例如:

CQLinq代码规则

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM