SgDotNet
Singapore Professional .NET User Group -For Cool Developers

How to suppress C# compiler warnings in VS.NET 2003

At the first glance I found no way to suppress C# compiler warnings in VS.NET 2003.

Writing "#pragma warning disable CSxxxx" simply does not work as it should in VC++ 6.

This happened when I tried to touch up a bunch of class libraries with proper documentation using NDoc. Some of the public constants or plublic properties and methods are so self-explanatory that I do not want to provide any comment at all. "warning CS1591: Missing XML comment for publicly visibletype or member ...." popped up.

It turned out that in order to suppress such a warning, I need to go to Project\Properties, Configuration Properties\Build, under Errors and Warnings\Suppress Specific Warning, fill up the number to be avoided, eg 1591.

Use /nowarn for the command line.


Posted Oct 01 2004, 02:10 AM by blackinkbottle
Filed under:
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems