Set alert suppression for website

I am working with a project of another developer that contains hundreds of obsolete method warnings. In compiled dlls I set warning suppression 618 (full warning number CS0618 ).

Is there a way to set the same setting on a website?

The problem is that there are so many outdated warnings that I cannot find any of the important ones.

+4
source share
1 answer

I believe that you need to specify this in the web.config file. See Also: Compiler Element and Web Project Settings

<system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/nowarn:618"/> </compilers> </system.codedom> 

An alternative would be to add a #pragma statement around each of the insult methods, but if there are hundreds, suppressing the blanket is likely to be faster.

 #pragma warning disable 612, 618 [Obsolete("Use something else instead")] #pragma warning restore 612, 618 
+6
source

All Articles