Vitor Canova
Vitor Canova

Reputation: 3976

How to disable warnings in only one project?

I have a legacy project in my solution without comments and many warnings. I want to not see warnings about this specific project but I want to see warnings of the other projects in the same solution.

Is it possible?

edit: I mean "all warnings" of specific project.

Upvotes: 30

Views: 12899

Answers (4)

Mike Parkhill
Mike Parkhill

Reputation: 5551

  1. In Visual Studio open the project's Properties tab
  2. Go to the "Build" tab
  3. Set the "Warning Level" to 0

For details on the different warning levels see:

C# Compiler Options > /warn (Specify Warning Level)

Upvotes: 38

Sergey Berezovskiy
Sergey Berezovskiy

Reputation: 236218

Open project properties. Build > Errors and warnings > Warning level

Select 0 warning level. Details you can read here.

Upvotes: 6

Dor Cohen
Dor Cohen

Reputation: 17080

Each project in Visual Studio has a "treat warnings as errors" option. Go through each of your projects and change that setting:

  1. Right-click on your project, select "Properties".
  2. Click "Build".
  3. Switch "Treat warnings as errors" from "All" to "Specific warnings" or "None".

Upvotes: 1

Steve
Steve

Reputation: 216293

Open the Properties of the project and go to the Build page.
Here you will find the Error & Warnings input box
Put the warning number to hide in the input box without the first two letters
If you have more than one warning separate them with colon or semi-colon

(Sorry if labels are not precise, I'm translating from another language VS)

Upvotes: 4

Related Questions