Skip to content

Use alias in BuildIntegratedInstallationContext, allowing aliased package installation and updating to work#7102

Merged
nkolev92 merged 3 commits intodevfrom
dev-nkolev92-fixPMUIPMCPackageInstallation
Feb 9, 2026
Merged

Use alias in BuildIntegratedInstallationContext, allowing aliased package installation and updating to work#7102
nkolev92 merged 3 commits intodevfrom
dev-nkolev92-fixPMUIPMCPackageInstallation

Conversation

@nkolev92
Copy link
Copy Markdown
Member

@nkolev92 nkolev92 commented Feb 4, 2026

Bug

Fixes: NuGet/Home#14539

Description

In this PR I am changing BuildIntegratedInstallationContext to use string aliases instead of the NuGetFramework now that duplicate NuGetFrameworks are allowed.

The solution is simple at the bottom of it.
When we create the installation context that's in charge of writing, we explicitly use the targetAlias.
Note that in legacy projects (always one framework), the alias is "". Note that while it's always coded as such, it's not enforced through nullability or anything like that, so we account for that in the NuGetPackageManager.

I had to add a few new public APIs to support the new conditional package installation.
Add package needs similar changes too, so in a follow-up PR I'll deprecate the old ones by marking them as obsolete.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

…e installation for duplicate frameworks in PM UI and PMC
@nkolev92 nkolev92 force-pushed the dev-nkolev92-fixPMUIPMCPackageInstallation branch from 1fca40d to 66d801f Compare February 5, 2026 17:38
@nkolev92 nkolev92 requested a review from zivkan February 5, 2026 17:45
@nkolev92 nkolev92 marked this pull request as ready for review February 5, 2026 17:45
@nkolev92 nkolev92 requested a review from a team as a code owner February 5, 2026 17:45
@nkolev92 nkolev92 requested a review from martinrrm February 5, 2026 17:45
Comment thread src/NuGet.Core/NuGet.ProjectModel/PackageSpecOperations.cs Outdated
Comment thread src/NuGet.Core/NuGet.ProjectModel/PackageSpecOperations.cs Outdated
@nkolev92 nkolev92 requested a review from martinrrm February 7, 2026 00:16
Comment thread src/NuGet.Core/NuGet.PackageManagement/NuGetPackageManager.cs Outdated
Comment thread src/NuGet.Core/NuGet.PackageManagement/NuGetPackageManager.cs Outdated
Comment thread src/NuGet.Core/NuGet.ProjectModel/PublicAPI.Unshipped.txt
Comment thread src/NuGet.Core/NuGet.ProjectModel/PackageSpecOperations.cs
@nkolev92 nkolev92 requested a review from zivkan February 7, 2026 00:33
@nkolev92 nkolev92 enabled auto-merge (squash) February 9, 2026 22:19
@nkolev92 nkolev92 merged commit 7ed3250 into dev Feb 9, 2026
17 checks passed
@nkolev92 nkolev92 deleted the dev-nkolev92-fixPMUIPMCPackageInstallation branch February 9, 2026 22:39
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.

Ensure PM UI and PMC updating support aliased package changes

3 participants