的FxCop和$ C C分析规则$ [英] FxCop and Code Analysis Rules

查看:193
本文介绍了的FxCop和$ C C分析规则$的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用code分析我在Visual Studio项目。我创建了一个自定义的规则集我所有的项目,其中包括两个微软定义的规则集来使用。我一直在努力的FxCop集成到CI构建过程失败,生成未通过的所有规则。什么是真正奇怪的对我来说,我不能用我的规则集来定义什么样的规则的FxCop扫描兑code。我如何使它所以Visual Studio的code解析规则匹配到的FxCop的规则?

I recently started using Code Analysis on my projects in Visual Studio. I have created a custom ruleset to use with all of my projects that include two of the Microsoft defined rulesets. I've been working to integrate FxCop into the CI build process to fail builds that don't pass all rules. What's really odd to me is that I can't use my ruleset to define what rules FxCop scans the code against. How do I make it so Visual Studio's Code Analysis rules match up to FxCop's rules?

推荐答案

您已经有了,我想你已经知道如何在您的项目整合和利用通过Visual Studio的规则集文件。

You already have a rule set file that I assume you have figured out how to integrate in your projects and utilize through Visual Studio.

您可以使用同样的规则集文件 FxCopCmd.exe

You can use this same rule set file in FxCopCmd.exe:

FxCopCmd.exe /out:Violations.xml /ruleset:=Custom.ruleset /file:MyAssembly.dll

我已经做到了这一点使用詹金斯和它工作得很好。运行 FxCopCmd.exe 不带任何参数,你应该看到的说明所有可用的命令行开关。

I have done this using Jenkins and it works just fine. Run FxCopCmd.exe with no arguments and you should see descriptions for all available command-line switches.

这篇关于的FxCop和$ C C分析规则$的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆