Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add TargetFramework alias to the GetReferenceNearestTargetFrameworkTask - #7011

#7011
Closed
nkolev92 wants to merge 4 commits into
devNuGet/NuGet.Client:devfrom
dev-nkolev92-addAliasToGetNearestTaskNuGet/NuGet.Client:dev-nkolev92-addAliasToGetNearestTaskCopy head branch name to clipboard
Closed

Add TargetFramework alias to the GetReferenceNearestTargetFrameworkTask#7011
nkolev92 wants to merge 4 commits into
devNuGet/NuGet.Client:devfrom
dev-nkolev92-addAliasToGetNearestTaskNuGet/NuGet.Client:dev-nkolev92-addAliasToGetNearestTaskCopy head branch name to clipboard

Conversation

@nkolev92

@nkolev92 nkolev92 commented Dec 16, 2025

Copy link
Copy Markdown
Member

Bug

Progress: NuGet/Home#14536

Description

In order to allow for E2E integration of the aliasing feature to work (ie, to verify that we can run build on an aliased lock file), we need the project reference protocol inputs to be setup.

https://github.com/NuGet/Home/blob/dev-nkolev92-tfmaliases/accepted/2025/Multiple-Equivalent-Framework-Support-TFM-As-Aliases.md#project-to-project-references

This PR adds the parameter to TargetFramework, which will be consider at a later point. #6972 is already implemented, but it's not at the quality we need it to be just yet because of the lack of the ability to add E2E tests at this point.

MSBuild side in dotnet/msbuild#12932.

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 changed the title Add TargetFramework alias to the get nearest task Add TargetFramework alias to the GetReferenceNearestTargetFrameworkTask Dec 16, 2025
@nkolev92
nkolev92 marked this pull request as ready for review December 16, 2025 02:09
@nkolev92
nkolev92 requested a review from a team as a code owner December 16, 2025 02:09
<PackageDownloadSupported>true</PackageDownloadSupported>
<!-- Mark that this targets file GetReferenceNearestTargetFrameworkTask task supports the TargetPlatformMoniker -->
<GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter>true</GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter>
<!-- Mark that this targets file GetReferenceNearestTargetFrameworkTask task supports the TargetFramework -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Link to the MSBuild PR or an Issue for reference?

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.

@zivkan
zivkan force-pushed the dev-nkolev92-addAliasToGetNearestTask branch from 3ced076 to a8cc064 Compare December 17, 2025 06:46
JanProvaznik pushed a commit to dotnet/msbuild that referenced this pull request Dec 19, 2025
Fixes #

### Context

Design: NuGet/Home#12124

To allow duplicate frameworks in aliasing, the project reference
protocol nearest framework selection needs to be updated to support
matching by alias as well.

Relevant part: 

https://github.com/NuGet/Home/blob/dev-nkolev92-tfmaliases/accepted/2025/Multiple-Equivalent-Framework-Support-TFM-As-Aliases.md#project-to-project-references

NuGet/NuGet.Client#7011 NuGet.Client side
adding the parameter.
NuGet/NuGet.Client#6972 will add the full
implementation at a later point.

### Changes Made

- Pass CurrentProjectTargetFrameworkProperty if
GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworKPropertyParameter
is set.
- If
GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworKPropertyParameter
is not set, but
GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter is
set, call the old variation.
- Otherwise calls the last variation.

### Testing

- Manual testing.
- I'd be happy to add tests if someone can point me in the right
direction.
### Notes

The idea here is to get ahead of things. Currently aliasing work can't
be end to end tested because it requires an msbuild change. It makes it
really hard to validate the NuGet changes are enough and good, but this
is the only change needed on the msbuild side.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Dec 31, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.