Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot suppress NU1702, which only shows for .NET Framework projects using new SDK format #9147

Closed
outbred opened this issue Feb 6, 2020 · 3 comments

Comments

@outbred
Copy link

outbred commented Feb 6, 2020

Details about Problem

NuGet product used : Package Manager Console
NuGet version: 5.4.0.6292
VS version: 16.4.4
OS version: Win10 v1903
Worked before? If so, with which NuGet version: nope

Detailed repro steps so we can see the same problem

Reference a .NET framework project using the new SDK format from a .NET Std 2.0 project, and you will see a warning like this:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1653,5): warning NU1702: ProjectReference 'C:\blah\blah.csproj' was resolved using '.NETFramework,Version=v4.7.2' instead of the project target framework '.NETStandard,Version=v2.0'. This project may not be fully compatible with your project.

There is no way to suppress this message, even with <NoWarn>$(NoWarn);NU1702;1702</NoWarn> in my project file (for Debug and Release builds).

NU1701 can be suppressed via the props dialog for the package, but the props dialog for the project has no 'No Warn' entry field.

Verbose Logs

not needed

Sample Project

This project has 2 .NET Framework projects in it - the warning shows for the new SDK formatted project, but not the other (old style format). Note that no project is multi-targeted.

DotNetFramework.zip

@heng-liu
Copy link
Contributor

Thanks for reporting this issue.
This is a duplicate of #8797.
Closed as a duplicate.

@rseanhall
Copy link

This needs to be reopened. #8797 had two issues in it - NoWarn and WarningsAsErrors. #8797 was closed as a duplicate of an issue about WarningsAsErrors, but the NoWarn part is still unaddressed.

@AdrianSanguineti
Copy link

@rseanhall, I think the actual correct duplicate issue is #8093 not #8797.

It gives the workaround of using <MSBuildWarningsAsMessages>NU1702</MSBuildWarningsAsMessages> instead of NoWarn to suppress the warning. This has appeared to have worked for me. From what I gather, #8093 was raised to address that NoWarn values are not read at all by the client which is why suppressing using NoWarn doesn't work. (At least how I've interpreted it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants