“抑制警告"Visual Studio 2010 中的 menuitem 不可用 [英] "Suppress Warning" menuitem in Visual Studio 2010 is not available

查看:22
本文介绍了“抑制警告"Visual Studio 2010 中的 menuitem 不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Visual Studio 2010 Ultimate,似乎无法像在 VS2008 中使用的那样抑制警告.

I'm using Visual Studio 2010 Ultimate, and it seems that I cannot suppress warnings in the way I used in VS2008.

我的项目是在 C# 中,当我右键单击错误列表"窗口中的警告时(例如,对于公共类型的缺少 XML 注释),我没有通常的菜单项来抑制此警告(既不在代码中也不在全局抑制文件中).

My project is in C#, and when I right click a warning in the "Error List" window (e.g. for a missing XML-comment of a public type), I do not have the usual menu item to suppress this warning (neither in code nor in the global suppressions file).

代码分析项目的属性是

在构建时启用代码分析(定义 CODE_ANALYSIS 常量)=> 未选中抑制生成代码的结果 => 已检查

Enable Code Analysis on Build (defines CODE_ANALYSIS constant) => not checked Suppress results from generated code => checked

在代码分析的解决方案属性中,我将所有配置和所有平台设置为使用Microsoft 所有规则"规则集.

In the solution's properties for Code Analysis I set all configurations and all platforms to use the "Microsoft All Rules" rule set.

知道为什么我不再获得菜单项了吗?非常感谢任何帮助,

Any ideas why I don't get the menu item anymore? Any help is greatly appreciated,

提前致谢&

最好的问候,

G.

推荐答案

我一直在努力解决这个问题,但不知怎么的,它似乎又恢复了.问题是我无法完全重现解决方案是什么,但无论如何,这是我尝试过的:-工具>自定义>命令>上下文菜单>单击全部重置"-在上下文菜单下检查>其他上下文菜单|错误列出"抑制消息"的预期条目存在,否则添加它.

I've been trying to get this thing fixed, and somehow it seems to be working again. The problem is that I cannot exactly reproduce what the solution was, but anyway, here is what I tried: - Tools > Customize > Commands > Context menu > Click "Reset All" - Check that under Context menu > "Other Context Menus | Error List" the expected entry for "Suppress message(s)" exists, otherwise add it.

您还必须记住的是,您只能抑制 FxCop 生成的消息,因此无法抑制源代码和 XML 注释中不匹配的参数.

What you also have to keep in mind is that you can only suppress messages generated by FxCop, so a mismatching parameter in source and XML comment cannot be suppressed.

这篇关于“抑制警告"Visual Studio 2010 中的 menuitem 不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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