views:

262

answers:

1

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?

+3  A: 

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
womp
It looks like the warning # is 1591, but the #pragma warning disable did the trick. Thanks.
brett rogers
If you want to do this across multiple files (in my case, thousands), you can apply the "warnings not as errors" element: http://stackoverflow.com/questions/267168/treat-all-warnings-as-errors-except-in-visual-studio
Rob Fonseca-Ensor