I am working with a project from another developer that has hundreds of obsolete method warnings. In the compiled dlls, I set suppress warnings 618 (the full warning number is CS0618).
Is there a way to set the same setting on a web site?
The problem is that there are so many obsolete warnings that I can't find any of the important ones.
I believe you need to specify this in the web.config. 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 #pragma statements around each of the offending methods, but if there are hundreds, the blanket suppression would probably be quicker.
#pragma warning disable 612, 618
[Obsolete("Use something else instead")]
#pragma warning restore 612, 618
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With