Repository navigation
PM UI: fix exception during package install to .NET Framework project with PackageReference - #3643
Merged
Merged
Conversation
dtivel
commented
Sep 4, 2020
sbanni
approved these changes
Sep 4, 2020
rrelyea
approved these changes
Sep 4, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: NuGet/Home#9995
Regression: Yes
Fix
Details: During the last rebase, I adapted to in incoming breaking change. What I didn't realize is that when installing a package to a .NET Framework project the first time when PackageReference project style is enabled there is a brief moment during the upgrade process where 2 projects exist simultaneously for the same project. One project is packages.config while the other project is PackageReference. When we fetch install actions during this time we need to ensure that the set of project ID's has no duplicates.
The fix involves adding a
.Distinct()call.This PR also removes a bunch of dead code and renames
ProjectUtility.GetProjectIdsAsync(...)to better reflect what it really does, lest someone (like me) be inclined to simplify the code to use the already cached ID's inIProjectContextInfo.ProjectIdand then lose sorting.Testing/Validation
Tests Added: No
Reason for not adding tests: already covered by manual test plan
Validation: manual