Skip to content

Update all package tfm conditionals when using PM UI - #7427

Merged
martinrrm merged 1 commit into
devfrom
dev-mruizmares-pmui-conditional-tfms
Jun 1, 2026
Merged

martinrrm merged 1 commit into
devfrom
dev-mruizmares-pmui-conditional-tfms

Conversation

@martinrrm

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#14159

Description

When installing or updating a package from the PM UI on a multi-targeted CPS project, NuGet only applied the change to a single target framework instead of all of them.

CpsPackageReferenceProject.InstallPackageAsync now routes based on whether the package is conditional:

  • Conditional (partial install, or different versions per framework): the per-framework conditional package references service is used, so each framework's reference is added/updated and the conditions are preserved.
  • Unconditional (same version across all frameworks): a single add/update on the suggested configured project, which applies to every target framework at once — covering both new installs and version updates.

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.

@martinrrm
martinrrm requested a review from a team as a code owner May 28, 2026 23:20
@martinrrm

Copy link
Copy Markdown
Contributor Author

While testing I realized that Project System AddAsync API is not working as expected in CPM, but I don't really know the expected behavior, so this change is not fixing it in an CPM scenario

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The test seem pretty involved, but they seem to cover the right scenarios.

@nkolev92

Copy link
Copy Markdown
Member

While testing I realized that Project System AddAsync API is not working as expected in CPM, but I don't really know the expected behavior, so this change is not fixing it in an CPM scenario

CPM with conditional references is challenging to say the least.

@martinrrm
martinrrm merged commit 6f98e9b into dev Jun 1, 2026
17 of 18 checks passed
@martinrrm
martinrrm deleted the dev-mruizmares-pmui-conditional-tfms branch June 1, 2026 18:16
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.

2 participants