3

This is an annoyance more than a problem. My project contains a number of autogenerated files (using mgmtclassgen.exe). When I generate the XML documentation, my beautifully commented library is plagued by xml documentation warnings from these autogen files.

Is there a way to either a) suppress generating documentation for these files or b) suppress warning CS1591 just for a set of files? I obviously do not want to modify files that are autogenerated, even if to just add suppression pragmas.

The library and generated code are both in C# and I'm using Visual Studio 2008.

2 Answers 2

1

AFAIK you cannot suppress this warning only for certain files. You could, if these warnings really bothers you, move the autogenerated code to a separate assembly for which you would disable XML documentation.

0

You can disable specific warnings using the #pragma directive, this might suit your purpose. The syntax for disabling the 'missing xml comment' warning is:

#pragma warning disable 1591    // Disable 'missing xml comment' warning

You can re-enable it using the following syntax:

#pragma warning restore 1591    // Restore 'missing xml comment' warning

This allows you to selectively ignore warnings for either part of a file or a complete file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.