views:

172

answers:

2

I can turn on warnings as errors and exclude certain warnings for all the projects in my solution except for a website (not web application).

Is there anyway to turn on 'warnings as errors' as errors for websites and is there anyway to turn off certain errors for the whole website or sub folders?

Update I'm using ASP.Net with C#

+3  A: 

The only way I know of is to add this to your web.config directly under your configuration element:

<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>

Here is where I originally found this trick.

Andrew Hare
+1  A: 

I asked this question a while ago on how to disable certain warnings in Visual Studio - it was specifically for VB.NET but I think you could apply it C#.

how-to-disable-warnings-in-visual-studio-for-a-visual-basic-web-deployment-project

David A Gibson