-
Notifications
You must be signed in to change notification settings - Fork 265
Description
Take a project such as the following:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NuGet.Protocol" Version="5.5.0" />
<PackageReference Include="NuGet.Protocol" Version="5.6.0" />
</ItemGroup>
</Project>Note the duplicate PackageReference declaration. Digging further reveals that different project types and different tools handle it differently.
See the below table for details
| Restore Flavor | PackageReference declaration |
|---|---|
| Commandline restore (all) | First |
| Static graph restore (all) | First |
| VS - SDK based projects | Last |
| VS - Legacy PR projects | First |
This leads to issues as the ones described in dotnet/arcade#5550 (see below repro).
I think logically from an msbuild perspective, we'd expect that the last value is the one that's resolved. This needs investigated and ideally consolidated.
Note that consolidating VS - LEgacy PR projects might be impossible, due to the fact that it's largely in maintenance mode.
See repro below.
cc folks that might have some thoughts around:
@jeffkl @davkean @dsplaisted @zivkan
WIP:
Design: https://github.com/NuGet/Home/compare/dev-nkolev92-duplicatesHandling
Implementation: https://github.com/NuGet/NuGet.Client/tree/dev-nkolev92-duplicatePRs