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

查看:65
本文介绍了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:

  • 通过更改项目来抑制警告 Properties > Build > Errors and warnings > Suppress warnings 通过输入第1591章
  • 添加 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天全站免登陆