Suppressing warnings for solution

I usually use pragma directives:

#pragma warning disable 1591 
// whatever member is lacking xml comments, or even the whole file
#pragma warning restore 1591

Verbatim from the link above:

disable: Do not issue the specified warning message(s).

If you really want to disable warnings solution-wide, there's no way to do it.

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

But it can be done project-wise, just like you were doing above; the only thing I would change is separating those codes using a comma and not a semicolon like in your picture (and without a comma in the end), e.g.:

1591,1701,1702,1705

That's because compiler options use a comma.


The way I do it solution-wide is to create a specific suppression file, for instance GlobalSuppressionsForTestProjects.cs, in a convenient solution-level location.

Then for each project of the solution where I want the suppression definitions applied, I add a link to the suppression file:

  • right-click on project -> Add -> Existing Item
  • in selection dialog, navigate to the suppression file
  • click on Add as Link

Add existing item as link

I learned this trick from this post where the same way was applied for AssemblyInfo.cs files.