dotnet / dotnet/project-system

NuGetTargetMoniker should not be reported to NuGet for restore

Open
#9,895 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

The NuGetTargetMoniker has not been used in the NuGet Client to my understanding, only in the build targets.

NuGet in the CLI only uses TargetFrameworkMoniker to actually infer the target framework.

I know there's some comments in https://github.com/dotnet/project-system/issues/4854, but that was prior to the rework sometime in the .NET 5 timeline.

NuGet itself on the CLI has always used the TargetPlatformIdentifier to detect UWP, so the VS switch is no longer (if it ever was necessary).
It even has the UAP checks: https://github.com/NuGet/NuGet.Client/blob/b260088dc6b3d3a1c3e76ad0422ce4ceb03bbcdd/src/NuGet.Core/NuGet.Commands/Utility/MSBuildProjectFrameworkUtility.cs#L241C57-L241C84

I'm assuming this technically carries risk about how VS would work, https://github.com/NuGet/NuGet.Client/blob/b260088dc6b3d3a1c3e76ad0422ce4ceb03bbcdd/src/NuGet.Core/NuGet.Commands/Utility/MSBuildProjectFrameworkUtility.cs#L241C57-L241C84, but I think the fact that NuGet on the CLI and VS would work differently when NuGetTargetMoniker is set should signal that there's some things to align.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.