Visual Studio禁用缺少的XML注释警告

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

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

发布评论

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

>www.elefans.com

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