13

Possible Duplicate:
Globally suppress c# compiler warnings

To not add to each file a line like:

#pragma warning disable 1573
Community
  • 1
  • 1
objMihail
  • 147
  • 1
  • 1
  • 7

1 Answers1

22

All compilation options are specified on the project level. MSBuild exists below the level of solutions.

To do it for each project, go to the Build tab in Project Properties and enter the warning number in the Suppress Warnings textbox.

Alpha
  • 7,586
  • 8
  • 59
  • 92
SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • That is per project, not for the entire solution. As far as I can tell, there's no way to do it on the solution level. – Void Star Sep 12 '16 at 21:44
  • @BigEndian: Correct; all compilation options are specified on the project level. MSBuild exists below the level of solutions. – SLaks Sep 13 '16 at 00:06
  • 1
    so if I have 200+ projects? – Dave Cousineau Sep 26 '19 at 16:36
  • Use e.g. Notepad++ replace in all project files with CS1591,CS1572,CS1573 (or whatever you want). Assuming you don't want different suppression in every project. – codah May 28 '20 at 04:39
  • 1
    same here, too many projects to do this individually. In 2019 there is this %(DisableSpecificWarnings) common variable - but I can't figure out how to change that one. – Axel Podehl Jun 05 '20 at 07:16
  • 9
    You can do this by adding Directory.Build.props file in the root of your solution and add this content to it , ` CS1591 ` – mysticdotnet Nov 18 '20 at 13:14