Articles → CSHARP → Use Pragma To Supress Complier Warning In C#Use Pragma To Supress Complier Warning In C#This article explains how to suppress C# compiler warnings using pragmas.Compiler Warning In Code Generally, programmers frequently encounter compiler warnings. For example, the Obsolete attribute applied to a property generates a warning (see screenshot below).Click to EnlargePragma Use the following syntax to suppress compiler warnings with pragma directives.#pragma warning disable Similarly, we can restore the warning using the following syntax.#pragma warning restore This code suppresses the warning.Click to EnlargePosted By - Karan Gupta Posted On - Monday, June 22, 2015 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
#pragma warning disable
#pragma warning restore
Query/Feedback