Visual Studio禁用缺少的XML注释警告 [英] Visual Studio Disabling Missing XML Comment Warning

查看:526
本文介绍了Visual Studio禁用缺少的XML注释警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有500多个Missing XML Comment警告.我知道我可以删除XML注释功能,也可以在任何地方粘贴空的注释片段,但是我更喜欢一种通用解决方案,在该解决方案中我可以进行更改以禁用所有此类警告.

I have a project with over 500 Missing XML Comment warnings. I know I can remove the XML Comment feature, or paste empty comment snippets everywhere, but I'd prefer a generic solution where I can make one change that disables all warnings of this type.

我刚才所做的是

///<Summary>
/// 
///</Summary>

#pragma warning disable 1591

只是好奇是否有可能.

推荐答案

如上所述,通常我不认为这些警告应该被忽略(抑制).总而言之,警告的解决方法是:

As suggested above, in general I don't think that these warnings should be ignored (suppressed). To summarise, the ways around the warning would be to:

  • 通过输入1591更改项目Properties> Build> Errors and warnings> Suppress warnings来取消警告
  • 添加XML文档标签( GhostDoc 对此非常方便)
  • 通过编译器选项禁止显示警告
  • 取消选中项目Properties> Build> Output
  • 中的"XML文档文件"复选框.
  • 在各个文件的顶部添加#pragma warning disable 1591,在底部的文件中添加#pragma warning restore 1591
  • Suppress the warning by changing the project Properties > Build > Errors and warnings > Suppress warnings by entering 1591
  • Add the XML documentation tags (GhostDoc can be quite handy for that)
  • Suppress the warning via compiler options
  • Uncheck the "XML documentation file" checkbox in project Properties > Build > Output
  • Add #pragma warning disable 1591 at the top of the respective file and #pragma warning restore 1591 at the bottom

这篇关于Visual Studio禁用缺少的XML注释警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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