Visual Studio 禁用缺少 XML 注释警告

编程入门 行业动态 更新时间:2024-10-24 00:28:57
本文介绍了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 注释警告

本文发布于:2023-11-13 00:56:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582968.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释   Visual   Studio   XML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!