-
Notifications
You must be signed in to change notification settings - Fork 263
Description
Repro
-
Create two .NETStandard projects and create a P2P reference: ProjA -> ProjB
-
Add the following package reference to ProjB:
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.0" />
</ItemGroup>
- Observe two NU1603 warnings, and corresponding warnings in the Dependencies Node:
- Suppress the warning in ProjB either with
NoWarn
metadata on the package reference, or a global NoWarn property, or through Project Properties UI
Expected
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.:
<ItemGroup>
<PackageReference Update="Newtonsoft.Json">
<NoWarn>NU1603</NoWarn>
</PackageReference>
</ItemGroup>
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