Skip to content

PM UI: fix exception during package install to .NET Framework project with PackageReference - #3643

Merged
dtivel merged 1 commit into
dev-feature-OE.PMUIfrom
dev-dtivel-oe-pmui-fix-exception
Sep 4, 2020
Merged

dtivel merged 1 commit into
dev-feature-OE.PMUIfrom
dev-dtivel-oe-pmui-fix-exception

Conversation

@dtivel

@dtivel dtivel commented Sep 4, 2020 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#9995
Regression: Yes

  • Last working version: previous build
  • How are we preventing it in future: dedupe project ID's

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 in IProjectContextInfo.ProjectId and then lose sorting.

Testing/Validation

Tests Added: No
Reason for not adding tests: already covered by manual test plan
Validation: manual

@dtivel
dtivel requested a review from a team as a code owner September 4, 2020 16:35
@dtivel
dtivel merged commit c975359 into dev-feature-OE.PMUI Sep 4, 2020
@dtivel
dtivel deleted the dev-dtivel-oe-pmui-fix-exception branch September 4, 2020 21:25
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.

3 participants