Skip to content

Use target graph name with framework - #7154

Merged
nkolev92 merged 3 commits into
release/7.3.xfrom
dev-nkolev92-useTargetGraphNameWithFramework
Feb 20, 2026
Merged

nkolev92 merged 3 commits into
release/7.3.xfrom
dev-nkolev92-useTargetGraphNameWithFramework

Conversation

@nkolev92

@nkolev92 nkolev92 commented Feb 19, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14756

Description

This is the patch friendly version of #7153.

In #6805 and more notably in #6923 a sizable part of the restore core logic was reworked to consider aliases as pivot instead of NuGetFramework.

Turns out that was handled pretty well in most cases, except in scenarios where the TargetFramework element does not actually match the GetShortFolderName of a framework.
In these cases, package specific suppressions do not work.
An example is net10.0-windows frameworks. Maui projects would probably suffer from the same issue as well as the linked issues suggest.

Originally in #6805 and #6923 a large majority of the internal restore infrastructure was changed to use string alias, instead of the NuGetFramework.
Note that this work was done in a way that didn't make intentional functional changes, but simply made changes that are purely internal.
Turns out that it ended up breaking package specific warning suppressions for aliased frameworks such as net10.0-windows. Projects like maui have this issue as well.
The root cause for that is that now all RestoreLogMessage have a target graph that has the alias. Note that this TargetGraphName is shared in many places, so it'll be really hard to understand the impact it'd have if we chnaged it for log messages only.

Workaround: Set the full name of the TargetFramework, so for net10.0-windows set net10.0-windows7.0.

The simplest solution here is to change the TargetGraphName to the previous behavior, which is framework/rid instead of alias/rid.

This is insufficient with aliasing, but plenty good for a patch.

The only place beyond NuGet where these strings are being read is the SDK and the SDK already knows how to handle both dotnet/sdk#50694, so this shouldn't be an issue.

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.

@nkolev92
nkolev92 marked this pull request as ready for review February 19, 2026 18:34
@nkolev92
nkolev92 requested a review from a team as a code owner February 19, 2026 18:34
@nkolev92
nkolev92 merged commit 89c92d0 into release/7.3.x Feb 20, 2026
16 checks passed
@nkolev92
nkolev92 deleted the dev-nkolev92-useTargetGraphNameWithFramework branch February 20, 2026 01:02
nkolev92 added a commit that referenced this pull request Feb 20, 2026
@nkolev92 nkolev92 mentioned this pull request Feb 20, 2026
3 tasks done
nkolev92 added a commit that referenced this pull request Feb 20, 2026
* Use target graph name with framework (#7154)

* Use TestConstants instead
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