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

GetReferenceNearestTargetFrameworkTask should support suppression of NU1702 #8093

Open
wtgodbe opened this issue May 3, 2019 · 5 comments
Open
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Type:Bug
Milestone

Comments

@wtgodbe
Copy link

wtgodbe commented May 3, 2019

Details about Problem

https://github.com/NuGet/NuGet.Client/blob/8abf12ddde3be7bc52727f9551735fdeee7ade43/src/NuGet.Core/NuGet.Build.Tasks/GetReferenceNearestTargetFrameworkTask.cs does not read NoWarn from the project referenced (or anywhere else), so any project trying to suppress NU1702 can't do so.

NuGet product used: dotnet.exe

dotnet.exe --version (if appropriate): 3.0.100-preview4

OS version (i.e. win10 v1607 (14393.321)): Windows 10

CC @ericstj

@ericstj ericstj changed the title GetReferenceNearestTargetFrameworkTask.cs should read NoWarn from the project GetReferenceNearestTargetFrameworkTask should support suppression of NU1702 May 3, 2019
@ericstj
Copy link

ericstj commented May 3, 2019

This is the AssetTargetFallback warning on ProjectReferences. It can be suppressed on PackageReference, but not on ProjectReference. The new SDK has started emiting this warning and those who treat warning as error are encountering a build failure.

@donnie-msft donnie-msft added this to the Backlog milestone May 6, 2019
@donnie-msft donnie-msft added Functionality:SDK The NuGet client packages published to nuget.org Type:Bug Priority:2 Issues for the current backlog. Functionality:Restore labels May 6, 2019
@joaorosado
Copy link

Is there any workaround for this?

@ericstj
Copy link

ericstj commented Oct 30, 2019

I believe you can pass /warnAsMessage:NU1702 to whatever invokes MSBuild for you. We did that here: https://github.com/dotnet/standard/pull/1173/files#diff-02389dfac0a172ab80211625efc34318R2

@joaorosado
Copy link

Thanks, that worked.

Following that, was also able to use <MSBuildWarningsAsMessages>NU1702</MSBuildWarningsAsMessages>
as workaround to avoid only having to change 1 project, instead of all the potential build commands.

@aortiz-msft aortiz-msft added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Priority:2 Issues for the current backlog. labels Apr 2, 2020
@nkolev92 nkolev92 added Priority:2 Issues for the current backlog. and removed Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. labels Apr 8, 2020
@nkolev92 nkolev92 added Category:Customer Sprint Area:ErrorHandling warnings and errors/log messages & related error codes. labels Nov 7, 2020
@zivkan zivkan removed the Functionality:SDK The NuGet client packages published to nuget.org label Nov 13, 2020
@ghost
Copy link

ghost commented Jan 10, 2021

NU1702

OK, so where about did you add this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

8 participants