How can i disable temporarily warnings/error from the code?
-
In VC++ was the #pragma warning directive, for example: #pragma warning( push ) // Store the current warning level for all warnings #pragma warning( disable : 4705 ) #pragma warning( disable : 4706 ) #pragma warning( disable : 4707 ) // Some code goes here... #pragma warning( pop ) // Pops the last warning level Is there any directive in C# that do the same job? Thanx in advanced!
-
In VC++ was the #pragma warning directive, for example: #pragma warning( push ) // Store the current warning level for all warnings #pragma warning( disable : 4705 ) #pragma warning( disable : 4706 ) #pragma warning( disable : 4707 ) // Some code goes here... #pragma warning( pop ) // Pops the last warning level Is there any directive in C# that do the same job? Thanx in advanced!
Project Properties -> Configuration Properties -> Suppress Specific Warnings Kevin
-
In VC++ was the #pragma warning directive, for example: #pragma warning( push ) // Store the current warning level for all warnings #pragma warning( disable : 4705 ) #pragma warning( disable : 4706 ) #pragma warning( disable : 4707 ) // Some code goes here... #pragma warning( pop ) // Pops the last warning level Is there any directive in C# that do the same job? Thanx in advanced!
I believe you can only do this using v2.0 of the .Net Framework
#pragma warning disable 0169, 0414
Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students View my Blog -
In VC++ was the #pragma warning directive, for example: #pragma warning( push ) // Store the current warning level for all warnings #pragma warning( disable : 4705 ) #pragma warning( disable : 4706 ) #pragma warning( disable : 4707 ) // Some code goes here... #pragma warning( pop ) // Pops the last warning level Is there any directive in C# that do the same job? Thanx in advanced!
-
-
Project Properties -> Configuration Properties -> Suppress Specific Warnings Kevin
-
THANX kevin, however - this setting is global to the project, to supress specific warning in specific portion of code and the restore it - now i have learned (by the other replyers of this post) that it is possible in .net 2.0 framework. Regards, ilan
Cool. I didn't know that. :) Kevin