bradgonesurfing
bradgonesurfing

Reputation: 32162

How to supress nuget warnings warnings in msbuild/visual studio

I have the following warning from VS2017

15>C:\Users\phelan\workspace\weincad.net\WeinCad.Plugin\WeinCad.Plugin.csproj : warning NU1602: FSharpx.Async 1.13.2 does not provide an inclusive lower bound for dependency FSharp.Control.AsyncSeq. An approximate best match of FSharp.Control.AsyncSeq 1.13.0 was resolved.

That is warning NU1602

I have added

  <PropertyGroup >
    <NoWarn>NU1602</NoWarn>   
  </PropertyGroup>

to my Directory.Build.props file.

Nuget documentation claims that the nuget warnings will be respected by the NoWarn directives.

The errors and warnings listed here are available only with PackageReference-based projects and NuGet 4.3.0. NuGet also honors MSBuild properties to suppress warnings or elevate them to errors. For more information, see How to: Suppress Compiler Warnings in the Visual Studio documentation.

but the suppression is not respected. Is this a bug or am I doing something wrong.

Upvotes: 4

Views: 2930

Answers (1)

Jacek Blaszczynski
Jacek Blaszczynski

Reputation: 3269

Most probably you are hitting a bug tracked by issue #5740 NoWarn on a package reference does not apply transitively to its dependencies in NuGet repo.

The warning is raised not due to direct project dependency FSharpx.Async 1.13.2 but by that package dependency FSharp.Control.AsyncSeq

Upvotes: 3

Related Questions