How to disable warnings in only one project?

2019-02-16 04:21发布

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.

4条回答
Root(大扎)
2楼-- · 2019-02-16 04:47

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)

查看更多
Viruses.
3楼-- · 2019-02-16 04:52
  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)

查看更多
看我几分像从前
4楼-- · 2019-02-16 04:58

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

Select 0 warning level. Details you can read here.

查看更多
叼着烟拽天下
5楼-- · 2019-02-16 04:58

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".
查看更多
登录 后发表回答