FxCop behavior in VS2010, Code Analysis, and SuppressMessage

人盡茶涼 提交于 2019-12-04 11:28:05
Nicole Calinoiu

Does SuppressMessage works for FxCopcmd.exe?

Yes. You will need to compile with the CODE_ANALYSIS compilation symbol defined in order for your SuppressMessage attributes to be included in your assembly. Once they're in there, the FxCop engine will recognize them, regardless of the mechanism used to run the analysis.

Why I get errors if Action is Warning, using Fxcopcmd.exe?

The issue level written to the FxCop-produced report always uses the level specified by the rule author. When you run from within Visual Studio, the Visual Studio integration plug-in overrides this level with the one specified in the ruleset. When you run fxcopcmd.exe, the only difference between a configuring a rule as a warning vs an error is that detection of an error-level rule violation will cause fxcopcmd.exe to return a non-zero exit code, thereby allowing you to break an automated build.

If you would prefer that fxcopcmd.exe use your level overrides when generating its report, you may want to consider making a suggestion at http://visualstudio.uservoice.com/.

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