tpower
tpower

Reputation: 56896

Can I change the warning settings for Web Sites in visual studio?

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#

Upvotes: 0

Views: 743

Answers (2)

David A Gibson
David A Gibson

Reputation: 2033

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

Upvotes: 1

Andrew Hare
Andrew Hare

Reputation: 351566

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.

Upvotes: 3

Related Questions