-
Notifications
You must be signed in to change notification settings - Fork 258
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
NoWarn does not flow transitively through P2P references #5501
Comments
I did some preliminary analysis. It seems that on restore, Newtonsoft.Json does flow up to ProjA as we take the flattened graph while restoring ProjA and that contains all the dependencies from ProjB. Will discuss this a bit more internally. |
Let's continue meeting on friday. for now, this is pushed to post 4.3 |
Moving to 4.4/To-Do based on internal discussion. |
Feedback ticket 463600 also raised this concern. |
|
@bording - Thanks for bringing up a great point. Unfortunately, current plan will not resolve your case. but you can easily work that by adding a project wide no warn property -
If you feel that your scenario needs to be resolved as well, please feel free to open up a new issue and link it here. We will add it to our next triage/discussion. hope this helps! |
@bording thanks! We will consider the issue. |
Spec for resolving this issue - https://github.com/NuGet/Home/wiki/%5BSpec%5D-Transitive-Warning-Properties |
…1672) Spec: https://github.com/NuGet/Home/wiki/%5BSpec%5D-Transitive-Warning-Properties Fixes: NuGet/Home#5691 and NuGet/Home#5501 This change adds the capability to flow `NoWarn` properties transitively. The details are in the spec along with a high level implementation detail section.
Merged: NuGet/NuGet.Client@4be29f3 |
Repro
Create two .NETStandard projects and create a P2P reference: ProjA -> ProjB
Add the following package reference to ProjB:
NoWarn
metadata on the package reference, or a global NoWarn property, or through Project Properties UIExpected
All warnings go away
Actual
The warning for ProjB goes away but the warning for ProjA remains in the error list, and is also in the assets file. The dependency node also displays what looks like a phantom warning for ProjA.
This phantom warning is happening because the diagnostic in the assets file was raised and sent to the dependencies node, but it is not displayed because the faulty package reference does not actually exist in ProjA. (Dependencies node should probably do better about not showing a warning icon if the underlying diagnostic is not visible)
Workaround is to also suppress the warning in ProjA, but this can only be done using a global NoWarn. Updating the transitive package reference in ProjA with an MSBuild "Update" does not work, i.e.:
Of course, another workaround is to explicitly add the project reference to ProjA instead of receiving it transitively.
Details about Problem
VS: d15prerel.26625.0
NuGet: 4.3.0-preview3-4168
dotnet.exe --version: 1.1.0-preview1-005051
/cc @mishra14 @emgarten @rrelyea @srivatsn
The text was updated successfully, but these errors were encountered: