Treat Warnings as Errors in ASP.NET 2.0

The web.config file controls all compilation settings in a default web site project. To treat compiler warnings as errors, you'll need the following in web.config:

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

Note: You can only twiddle with compiler settings under full trust, but then you'll only need this setting at build time.

Print | posted @ Friday, August 11, 2006 2:30 AM

Comments on this entry:

No comments posted yet.

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 4 and 7 and type the answer here: