visual-studiovisual-studio-2017

Suppressing warnings for solution


I can't seem to be able to suppress warnings in my solution in Visual Studio 2017 by going into Project Settings > Build > Suppress warnings:

enter image description here

Even when I clean - build, rebuild, etc... the solution, Visual Studio keeps bringing up these warnings for me.

I brought this up with a visualstudio.com report yesterday and it's "triaged" at the moment. Is there an alternative way to suppress warnings in the solution, without marking every single reference?

Version: 15.6.2

Update: This is wierd. Visual Studio 2017 uses a semicolon by default, but comma worked.


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.