“Suppress Warning” menuitem in Visual Studio 2010 is not available

雨燕双飞 提交于 2019-12-23 07:29:11

问题


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

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).

The project's properties for Code Analysis are

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

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,

thanks in advance &

Best regards,

G.


回答1:


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.

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.




回答2:


I had the same problem. To me it seem to be a little confusing that the "Error list" contains both "Run Code Analysis"-messages and "build projet/solution"-messages. The menu can only appear if the code analysis is run explicitly. The messages in the list are also a little bit different depending there origination. If the "suppress" option should appear in the context menu, the message must start with "CAxxxx ..."



来源:https://stackoverflow.com/questions/3617107/suppress-warning-menuitem-in-visual-studio-2010-is-not-available

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