Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding missing XML comments content with Visual Studio

Throughout or C# sourcecode we have a lot of comments that miss the actual content such like this:

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

or this:

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

or this:

/// <param Name="flag"></param>

Unfortunately Visual Studio does not generate warnings for this type of missing comments. But for us it would be nice if we could just klick on an item in a list (eg. the warings list) inside visual studio and then be taken to the faulty location in source code to correct it. Also it would be nice to see the list of missing xml comment content upon each build of the xml files. Do you have any idea on how to achieve this?

like image 608
bitbonk Avatar asked Nov 05 '08 08:11

bitbonk


People also ask

How do I get rid of missing XML comments?

Possible solutions to disable missing comment warnings in Visual Studio: Suppress the warning by changing the project settings => Build tab => Errors and warnings => Suppress warnings by entering 1591. Uncheck the "XML documentation file" checkbox in project settings => Build tab => Output.

How do I enable XML comment analysis?

Enabling XML Comments XML comments are enabled by default in Visual Basic projects, and cannot be disabled. To enable or disable XML comments for a specific project, go to the project properties page, the Compile tab, and update the "Generate XML documentation file" checkbox.


1 Answers

Try 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.

From the feature list:

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

Usage from 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

like image 167
xsl Avatar answered Oct 03 '22 06:10

xsl