Skip to content

Conversation

@jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Aug 30, 2022

Bug

Fixes: NuGet/Home#12021

Regression? Last working version:

Description

When a user specified custom build ordering in a solution file, MSBuild generates a ProjectReference on the fly. If a user still has an actual ProjectReference in a project, NuGet will get the PackageReference and PackageVersions items twice with duplicates in the restore graph.

This updates the logic to handle duplicates by implementing a last one wins strategy.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@jeffkl jeffkl changed the title Properly handle duplicate central package versions during restore Properly handle duplicate central package version items in the restore graph when using custom build ordering in a solution file Aug 30, 2022
@jeffkl jeffkl requested a review from nkolev92 August 31, 2022 19:28
nkolev92
nkolev92 previously approved these changes Aug 31, 2022
@jeffkl jeffkl force-pushed the dev-jeffkl-handle-duplicate-centralpackageversions branch from 5acf8a1 to 3906a1c Compare August 31, 2022 21:54
@jeffkl jeffkl force-pushed the dev-jeffkl-handle-duplicate-centralpackageversions branch from 3906a1c to c7f47b7 Compare August 31, 2022 21:54
@jeffkl jeffkl requested a review from nkolev92 August 31, 2022 21:59
Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding that extra test!

@jeffkl jeffkl merged commit 586d6d6 into dev Sep 1, 2022
@jeffkl jeffkl deleted the dev-jeffkl-handle-duplicate-centralpackageversions branch September 1, 2022 15:47
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

Successfully merging this pull request may close these issues.

[Bug]: "An item with the same key has already been added" when migrating to CPM with ProjectDependencies in solution file

4 participants