VS2010代码分析-导出/打印项目的所有选中和未选中的规则
是否可以获得 ac# 项目中所有选定的活动规则的报告(导出或打印)?
我可以打开 .ruleset 文件并选中/取消选中特定规则,但是,我似乎可以打印列表或从该屏幕获取任何输出。
无法打印活动规则列表,是否有所有现有 VS2010 规则的列表?我可以拿走这个并删除任何被禁用的东西。
Is it possible to obtain a report (export or print) of all the selected rules active for a c# project?
I am able to open the .ruleset file and check/uncheck the specific rules, however, I can seem to print the list or obtain any output from this screen at all.
Failing the ability to print the list of rules active, is there a list of all the stock VS2010 rules? I can take this and remove any that are disabled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现最简单的方法是获取规则列表并进行编辑未得到执行的规则。
The easiest way I found was to get the list of rules and edit out the rules that are not being enforced.
.ruleset 文件只是一个 XML 文件。如果您愿意,可以使用 XSLT 对其进行格式化,或者如果您愿意,可以将其简单地导入到 Excel 中以进行更多手动“处理”。
如果需要将规则 CheckId 值映射到其名称,可以从规则 DLL 中提取规则资源 XML。例如,命名规则的描述位于 [Visual Studio]\Team Tools\Static Analysis Tools\FxCop\Rules\NamingRules.dll 文件中名为 Microsoft.FxCop.Rules.Naming.NamingRules.xml 的嵌入式资源中。
如果您认为 .ruleset 文件应该可以通过 Visual Studio 打印,您可能需要考虑在 http://visualstudio.uservoice.com/forums/121579-visual-studio。
The .ruleset file is just an XML file. It can be formatted using XSLT if you like, or simply imported into Excel for more manual "massaging" if you prefer.
If you need to map the rule CheckId values to their names, you can extract the rule resource XML from the rule DLLs. For example, the descriptions of the naming rules are in an embedded resource named Microsoft.FxCop.Rules.Naming.NamingRules.xml in the [Visual Studio]\Team Tools\Static Analysis Tools\FxCop\Rules\NamingRules.dll file.
If you think that the .ruleset file should be printable via Visual Studio, you may want to consider adding a suggestion at http://visualstudio.uservoice.com/forums/121579-visual-studio.