I have a Visual Studio (C#) project in which the "XML documentation file" property is enabled. It also has "Treat warnings as errors" set to All.
There is one particular class which has no XML comments and they will not be added to it. Since XML documentation and warnings as errors are enabled, this causes builds to fail.
Is there a way to ignore this specific class when it comes to XML documentation?
From the menu bar, choose Tools > Options to open the Options dialog box. Then, navigate to Text Editor > C# (or Visual Basic) > Advanced. In the Editor Help section, look for the Generate XML documentation comments option.
The C# compiler combines the structure of the C# code with the text of the comments into a single XML document. The C# compiler verifies that the comments match the API signatures for relevant tags. Tools that process the XML documentation files can define XML elements and attributes specific to those tools.
In the class file, place a pragma at the top of the file to disable the given warning number.
#pragma warning disable (warning #)
The error number for xml documentation warnings is 1591, so it looks like:
#pragma warning disable 1591
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With