From ef91a3290b4b8b01188b529725c2db41085157c9 Mon Sep 17 00:00:00 2001 From: Nikolche Kolev Date: Fri, 12 Dec 2025 11:07:59 -0800 Subject: [PATCH 1/4] Add extra parameter to get nearest --- .../Microsoft.Common.CurrentVersion.targets | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 3a79ff08b6a..b39899cd22a 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -1883,16 +1883,30 @@ Copyright (C) Microsoft Corporation. All rights reserved. - + And '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworKPropertyParameter)' == 'true' and '%(_ProjectReferenceTargetFrameworkPossibilities.IsVcxOrNativeProj)' != 'true'"> + + + + + + From b5d121955f1902486f2427f26c8fc2ed92ac5bd9 Mon Sep 17 00:00:00 2001 From: Nikolche Kolev Date: Mon, 15 Dec 2025 18:14:57 -0800 Subject: [PATCH 2/4] cleanup --- src/Tasks/Microsoft.Common.CurrentVersion.targets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index b39899cd22a..739bb2a4c09 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -1883,7 +1883,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. - + And '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworkPropertyParameter)' == 'true' and '%(_ProjectReferenceTargetFrameworkPossibilities.IsVcxOrNativeProj)' != 'true'"> - + And '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter)' == 'true' and '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworkPropertyParameter)' != 'true' and '%(_ProjectReferenceTargetFrameworkPossibilities.IsVcxOrNativeProj)' != 'true'"> From 559afaba0cbbf28c8bf0114adebf37602d181e46 Mon Sep 17 00:00:00 2001 From: Nikolche Kolev Date: Mon, 15 Dec 2025 18:17:31 -0800 Subject: [PATCH 3/4] add docs too --- documentation/ProjectReference-Protocol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/ProjectReference-Protocol.md b/documentation/ProjectReference-Protocol.md index 2497ff6eb37..d32184d9afa 100644 --- a/documentation/ProjectReference-Protocol.md +++ b/documentation/ProjectReference-Protocol.md @@ -61,7 +61,7 @@ If implementing a project with an “outer” (determine what properties to pass * `Platforms` indicating what platforms are available for the project to build as, and boolean metadata `IsVcxOrNativeProj` (used for [SetPlatform Negotiation](#setplatform-negotiation)) * The `GetReferenceNearestTargetFrameworkTask` (provided by NuGet) is responsible for selecting the best matching `TargetFramework` of the referenced project * This target is _optional_. If not present, the reference will be built with no additional properties. - * **New** in MSBuild 15.5. (`TargetFrameworkMonikers` and `TargetPlatformMonikers` metadata is new in MSBuild 16.8) + * **New** in MSBuild 15.5. (`TargetFrameworkMonikers` and `TargetPlatformMonikers` metadata is new in MSBuild 16.8, `TargetFramework` metadata is new in MSBuild 18.3) * It is possible to gather additional information from referenced projects. See the below section on "Getting additional properties from referenced projects" for more information * `GetTargetFrameworkProperties` determines what properties should be passed to the “main” target for a given `ReferringTargetFramework`. * **Deprecated** in MSBuild 15.5. From 4487be2933b975d95780069f10b444c10a57594b Mon Sep 17 00:00:00 2001 From: Nikolche Kolev Date: Mon, 15 Dec 2025 18:20:07 -0800 Subject: [PATCH 4/4] Update src/Tasks/Microsoft.Common.CurrentVersion.targets Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Tasks/Microsoft.Common.CurrentVersion.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 739bb2a4c09..4db3d552c7e 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -1883,7 +1883,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. -