gpt4 book ai didi

visual-studio - 使用 Visual Studio 查找缺失的 XML 注释内容

转载 作者:行者123 更新时间:2023-12-04 10:33:13 25 4
gpt4 key购买 nike

在整个或 C# 源代码中,我们有很多缺少实际内容的注释,例如:

/// <summary>
/// </summary>

或这个:
/// <summary>
///
/// </summary>

或这个:
/// <param Name="flag"></param>

不幸的是,Visual Studio 不会为这种类型的缺失注释生成警告。但是对我们来说,如果我们可以在 Visual Studio 中点击列表(例如,warings 列表)中的一个项目,然后被带到源代码中的错误位置来纠正它,那就太好了。此外,在每次构建 xml 文件时看到缺少的 xml 注释内容列表也很不错。您对如何实现这一目标有任何想法吗?

最佳答案

试试 XML Comment Checker :

XML Comment Checker is an application that will check the XML documentation for a .Net assembly for omissions. It offers a more comprehensive checking than the C# compiler itself, and is ideal for when you wish to check your comments before compiling them into real documentation, e.g using Microsoft Sandcastle.



从功能列表:

Check for empty sections. Optionally, XML Comment Checker will warn if any of the required sections or elements are present, but empty. This is not enabled by default



Visual Studio 中的用法:

XML Comment Checker can be set as the post-build event in Visual Studio to check an assembly automatically. The warnings emitted by XML Comment Checker have been formatted so that Visual Studio will recognize them and display them in the Error List. An example post-build command line: "PathToCommentChecker\CommentChecker.exe" "$(TargetPath)" -nologo -warnemptysections

关于visual-studio - 使用 Visual Studio 查找缺失的 XML 注释内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/264623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com