From 1949e1701a8ef172d9e150f600909f0f46034219 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 9 Jul 2025 12:54:11 -0700 Subject: [PATCH 1/9] Support '1.' TFM for CsWinRT 3.0 --- eng/ManualVersions.props | 11 +++++++++++ .../targets/GenerateBundledVersions.targets | 17 +++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/eng/ManualVersions.props b/eng/ManualVersions.props index 9b67e035d26a..9738c1935cc5 100644 --- a/eng/ManualVersions.props +++ b/eng/ManualVersions.props @@ -9,6 +9,17 @@ Basically: In this file, choose the highest version when resolving merge conflicts. --> + + + 10.0.17763.57 + 10.0.18362.57 + 10.0.19041.57 + 10.0.20348.57 + 10.0.22000.57 + 10.0.22621.57 + 10.0.26100.57 + + 10.0.17763.57 10.0.18362.57 10.0.19041.57 diff --git a/src/Layout/redist/targets/GenerateBundledVersions.targets b/src/Layout/redist/targets/GenerateBundledVersions.targets index b8cb17d9d978..d8b1e1884e5c 100644 --- a/src/Layout/redist/targets/GenerateBundledVersions.targets +++ b/src/Layout/redist/targets/GenerateBundledVersions.targets @@ -1314,8 +1314,21 @@ Copyright (c) .NET Foundation. All rights reserved. TargetingPackName="NETStandard.Library.Ref" TargetingPackVersion="$(NETStandardLibraryRefPackageVersion)" /> - - + + + + + + + + + + + From ca64caffc7c47821c0963a0833ed104a33ac0f7f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 9 Jul 2025 13:37:50 -0700 Subject: [PATCH 2/9] Add 'UsingPreviewCsWinRT3_0Feature' warning --- src/Tasks/Common/Resources/Strings.resx | 7 +++++-- src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.de.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.es.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.it.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf | 5 +++++ src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf | 5 +++++ .../targets/Microsoft.NET.Windows.targets | 12 ++++++++++++ 15 files changed, 82 insertions(+), 2 deletions(-) diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx index 46d7589727a5..bbebadd53f08 100644 --- a/src/Tasks/Common/Resources/Strings.resx +++ b/src/Tasks/Common/Resources/Strings.resx @@ -875,7 +875,6 @@ You may need to build the project on another operating system or architecture, o NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - {StrBegins="NETSDK1197: "} NETSDK1198: A publish profile with the name '{0}' was not found in the project. Set the PublishProfile property to a valid file name. @@ -995,4 +994,8 @@ You may need to build the project on another operating system or architecture, o NETSDK1228: This project depends on the Aspire Workload which has been deprecated. Aspire now ships via NuGet packages and no longer requires a workload. Please visit {0} for upgrade guidance. {StrBegins="NETSDK1228: "} - + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index e5db44587134..79b3b0cada71 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: K sestavování desktopových aplikací pro Windows se vyžaduje Microsoft.NET.Sdk.WindowsDesktop. Aktuální verze sady SDK nepodporuje hodnoty UseWpf a UseWindowsForms. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: Používáte verzi Preview rozhraní .NET. Viz: https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index c246782b9f1c..589eedc07a2a 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: Für das Erstellen von Windows-Desktopanwendungen ist Microsoft.NET.Sdk.WindowsDesktop erforderlich. "UseWpf" und "UseWindowsForms" werden vom aktuellen SDK nicht unterstützt. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: Sie verwenden eine Vorschauversion von .NET. Weitere Informationen: https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index 0bf7f4613d62..0a14687ca819 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: Se requiere Microsoft.NET.Sdk.WindowsDesktop para compilar las aplicaciones de escritorio de Windows. El SDK actual no admite "UseWpf" ni "UseWindowsForms". {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: Está usando una versión preliminar de .NET. Visite: https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index d3f640ff0d76..7661d5070311 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: vous devez disposer de Microsoft.NET.Sdk.WindowsDesktop pour générer des applications de bureau Windows. 'UseWpf' et 'UseWindowsForms' ne sont pas pris en charge par le kit SDK actuel. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: vous utilisez une version d'aperçu de .NET. Voir : https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index 6ac472c5fc66..96f5b2ab7974 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: per compilare applicazioni desktop di Windows, è necessario Microsoft.NET.Sdk.WindowsDesktop. 'UseWpf' e 'UseWindowsForms' non sono supportati dall'SDK corrente. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: si sta usando una versione in anteprima di .NET. Vedere https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index bb47aae43458..89481a1d9ff5 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: Windows デスクトップ アプリケーションを作成するには、Microsoft.NET.Sdk.WindowsDesktop が必要です。現在の SDK では、'UseWpf' と 'UseWindowsForms' はサポートされていません。 {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: プレビュー版の .NET を使用しています。https://aka.ms/dotnet-support-policy をご覧ください diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index b73e728c7177..45b18dbc015f 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop을 사용하려면 Windows 데스크톱 애플리케이션을 빌드해야 합니다. 'UseWpf' 및 'UseWindowsForms'는 현재 SDK에서 지원하지 않습니다. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: .NET의 미리 보기 버전을 사용하고 있습니다. 참조: https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index 2ab598421867..83a2569fb663 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: Do kompilowania aplikacji klasycznych systemu Windows konieczny jest zestaw Microsoft.NET.Sdk.WindowsDesktop. Właściwości „UseWpf” i „UseWindowsForms” nie są obsługiwane przez bieżący zestaw SDK. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: Korzystasz z wersji zapoznawczej platformy .NET. Zobacz: ttps://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index 1932439c9340..cd0cf0b24a20 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop é necessário para compilar aplicativos da área de trabalho do Windows. Não há suporte para 'UseWpf' e 'UseWindowsForms' no SDK atual. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: Você está usando uma versão de visualização do .NET. Veja: https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index f8a1ae31c21f..b5aa4f4aca7b 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: для сборки классических приложений для Windows требуется Microsoft.NET.Sdk.WindowsDesktop. "UseWpf" и "UseWindowsForms" не поддерживаются текущим пакетом SDK. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: Вы используете предварительную версию .NET. Дополнительные сведения см. на странице https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index 9e0915877476..966edca2f615 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: Windows Masaüstü uygulamalarını derlemek için Microsoft.NET.Sdk.WindowsDesktop gereklidir. 'UseWpf' ve 'UseWindowsForms' geçerli SDK tarafından desteklenmiyor. {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: Bir .NET önizleme sürümü kullanıyorsunuz. Bkz. https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index 1b093b67114d..ba33dd01d3cf 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: 要构建 Windows 桌面应用程序,需使用 Microsoft.NET.Sdk.WindowsDesktop。当前 SDK 不支持 "UseWpf" 和 "UseWindowsForms"。 {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: 你正在使用 .NET 的预览版。请参阅 https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index a22286f247f4..aa8e45f67284 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -1043,6 +1043,11 @@ The following are names of parameters or literal values and should not be transl NETSDK1107: 需有 Microsoft.NET.Sdk.WindowsDesktop 才能建置 Windows 傳統型應用程式。目前的 SDK 不支援 'UseWpf' 和 'UseWindowsForms'。 {StrBegins="NETSDK1107: "} + + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + {StrBegins="NETSDK1229: "} + NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy NETSDK1057: 您目前使用的是 .NET 預覽版。請參閱: https://aka.ms/dotnet-support-policy diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets index 644d0faa4658..2c126237bfa6 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets @@ -167,4 +167,16 @@ Copyright (c) .NET Foundation. All rights reserved. and '$(UseUwp)' == 'true' "> + + + + + From 0345fdfedad8582f8198c6c5f3994aeaf6a62939 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 9 Jul 2025 13:39:28 -0700 Subject: [PATCH 3/9] Add test for new preview warning --- ...ThatWeWantToBuildAWindowsDesktopProject.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs index 9f2d59cbab70..d8c129cf4e5a 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs @@ -478,6 +478,26 @@ public void ItDoesNotWarnAnymoreWhenBuildingAProjectWithUseUwpProperty() .NotHaveStdOutContaining("NETSDK1219"); } + [WindowsOnlyFact] + public void ItWarnsWhenBuildingAProjectTargetingCsWinRT3_0() + { + TestProject testProject = new() + { + Name = "A", + ProjectSdk = "Microsoft.NET.Sdk", + TargetFrameworks = "net10.0-windows10.0.22621.1" + }; + + var testAsset = _testAssetsManager.CreateTestProject(testProject); + + var buildCommand = new BuildCommand(testAsset); + buildCommand.Execute() + .Should() + .Pass() + .And + .NotHaveStdOutContaining("NETSDK1229"); + } + [WindowsOnlyFact] public void ItErrorsWhenTargetingBelowNet6WithUseUwpProperty() { From a8392d78f4f6be7269006762280896dc93202261 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 9 Jul 2025 13:56:54 -0700 Subject: [PATCH 4/9] Run 'msbuild /t:UpdateXlf' --- src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.de.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.es.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.it.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index 79b3b0cada71..4e5b591459c8 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: Projekt(y) několika řešení obsahuj(e/í) konfliktní hodnoty „{0}“; ujistěte se, že se hodnoty shodují. Zvažte použití souboru Directory.build.props k nastavení vlastnosti pro všechny projekty. Konfliktní projekty: + NETSDK1197: Projekt(y) několika řešení obsahuj(e/í) konfliktní hodnoty „{0}“; ujistěte se, že se hodnoty shodují. Zvažte použití souboru Directory.build.props k nastavení vlastnosti pro všechny projekty. Konfliktní projekty: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index 589eedc07a2a..90c80bb7a38a 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: Mehrere Projektmappenprojekte enthalten widersprüchliche Werte für "{0}". Stellen Sie sicher, dass die Werte übereinstimmen. Erwägen Sie die Verwendung einer Directory.build.props-Datei, um die Eigenschaft für alle Projekte festzulegen. In Konflikt stehende Projekte: + NETSDK1197: Mehrere Projektmappenprojekte enthalten widersprüchliche Werte für "{0}". Stellen Sie sicher, dass die Werte übereinstimmen. Erwägen Sie die Verwendung einer Directory.build.props-Datei, um die Eigenschaft für alle Projekte festzulegen. In Konflikt stehende Projekte: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index 0a14687ca819..20107e912a1a 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: Varios proyectos de solución que contienen valores '{0}' en conflicto; asegúrese de que los valores coinciden. Considere la posibilidad de usar un archivo Directory.build.props para establecer la propiedad para todos los proyectos. Proyectos en conflicto: + NETSDK1197: Varios proyectos de solución que contienen valores '{0}' en conflicto; asegúrese de que los valores coinciden. Considere la posibilidad de usar un archivo Directory.build.props para establecer la propiedad para todos los proyectos. Proyectos en conflicto: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index 7661d5070311..ee09bd071ee5 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: plusieurs projets de solution contiennent des valeurs '{0}' en conflit ; assurez-vous que les valeurs correspondent. Envisagez d'utiliser un fichier Directory.build.props pour définir la propriété pour tous les projets. Projets conflictuels : + NETSDK1197: plusieurs projets de solution contiennent des valeurs '{0}' en conflit ; assurez-vous que les valeurs correspondent. Envisagez d'utiliser un fichier Directory.build.props pour définir la propriété pour tous les projets. Projets conflictuels : {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index 96f5b2ab7974..d161406ddd1d 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: più progetti della soluzione contengono valori '{0}' in conflitto. Verificare che i valori corrispondano. Provare a usare un file Directory.build.props per impostare la proprietà di tutti i progetti. Progetti in conflitto: + NETSDK1197: più progetti della soluzione contengono valori '{0}' in conflitto. Verificare che i valori corrispondano. Provare a usare un file Directory.build.props per impostare la proprietà di tutti i progetti. Progetti in conflitto: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index 89481a1d9ff5..3c93be7a54ce 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: 複数のソリューションのプロジェクトに、競合する '{0}' 値が含まれています。値が一致するようにしてください。Directory.build.props ファイルを使用して、すべてのプロジェクトのプロパティを設定することを検討してください。競合するプロジェクト: + NETSDK1197: 複数のソリューションのプロジェクトに、競合する '{0}' 値が含まれています。値が一致するようにしてください。Directory.build.props ファイルを使用して、すべてのプロジェクトのプロパティを設定することを検討してください。競合するプロジェクト: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index 45b18dbc015f..8a5420710946 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: 여러 솔루션 프로젝트에 충돌하는 '{0}' 값이 있습니다. 값이 일치하는지 확인하세요. Directory.build.props 파일을 사용하여 모든 프로젝트에 대한 속성을 설정하는 것이 좋습니다. 충돌하는 프로젝트: + NETSDK1197: 여러 솔루션 프로젝트에 충돌하는 '{0}' 값이 있습니다. 값이 일치하는지 확인하세요. Directory.build.props 파일을 사용하여 모든 프로젝트에 대한 속성을 설정하는 것이 좋습니다. 충돌하는 프로젝트: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index 83a2569fb663..3032f4c2e863 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: Wiele projektów rozwiązań zawiera wartości „{0}” powodujące konflikt; upewnij się, że wartości są zgodne. Rozważ użycie pliku Directory.build.props na potrzeby ustawienia właściwości dla wszystkich projektów. Projekty powodujące konflikt: + NETSDK1197: Wiele projektów rozwiązań zawiera wartości „{0}” powodujące konflikt; upewnij się, że wartości są zgodne. Rozważ użycie pliku Directory.build.props na potrzeby ustawienia właściwości dla wszystkich projektów. Projekty powodujące konflikt: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index cd0cf0b24a20..80d63e09ccdf 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: Vários projetos de solução contêm valores '{0}' conflitantes; garantir que os valores correspondam. Considere usar um arquivo Directory.build.props para configurar a propriedade para todos os projetos. Projetos conflitantes: + NETSDK1197: Vários projetos de solução contêm valores '{0}' conflitantes; garantir que os valores correspondam. Considere usar um arquivo Directory.build.props para configurar a propriedade para todos os projetos. Projetos conflitantes: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index b5aa4f4aca7b..5c99f99a2821 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: несколько проектов решения содержат конфликтующие значения "{0}". Убедитесь, что значения совпадают. Рассмотрите возможность использования файла Directory.build.props для настройки свойства для всех проектов. Конфликтующие проекты: + NETSDK1197: несколько проектов решения содержат конфликтующие значения "{0}". Убедитесь, что значения совпадают. Рассмотрите возможность использования файла Directory.build.props для настройки свойства для всех проектов. Конфликтующие проекты: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index 966edca2f615..797e7819f3d4 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: Birden çok çözüm projesi çakışan '{0}' değerleri içeriyor; değerlerin eşleştiğinden emin olun. Özelliği tüm projeler için ayarlamak için Directory.build.props dosyası kullanabilirsiniz. Çakışan projeler: + NETSDK1197: Birden çok çözüm projesi çakışan '{0}' değerleri içeriyor; değerlerin eşleştiğinden emin olun. Özelliği tüm projeler için ayarlamak için Directory.build.props dosyası kullanabilirsiniz. Çakışan projeler: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index ba33dd01d3cf..bc3a782cdc6b 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: 多个解决方案项目包含存在冲突的“{0}”值;请确保值能够匹配。请考虑使用 Directory.build.props 文件设置所有项目的属性。存在冲突的项目: + NETSDK1197: 多个解决方案项目包含存在冲突的“{0}”值;请确保值能够匹配。请考虑使用 Directory.build.props 文件设置所有项目的属性。存在冲突的项目: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index aa8e45f67284..1c79bd08a394 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -904,9 +904,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1197: Multiple solution project(s) contain conflicting '{0}' values; ensure the values match. Consider using a Directory.build.props file to set the property for all projects. Conflicting projects: {1} - NETSDK1197: 多個解決方案專案包含衝突的 '{0}' 值; 請確保值相符。考慮使用 Directory.build.props 檔案來設定所有專案的屬性。衝突的專案: + NETSDK1197: 多個解決方案專案包含衝突的 '{0}' 值; 請確保值相符。考慮使用 Directory.build.props 檔案來設定所有專案的屬性。衝突的專案: {1} - {StrBegins="NETSDK1197: "} + NETSDK1138: The target framework '{0}' is out of support and will not receive security updates in the future. Please refer to {1} for more information about the support policy. From 09974a485876adffeae2adbc80384ac6a02e4b66 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 15 Jul 2025 09:35:46 -0700 Subject: [PATCH 5/9] Update 'TargetPlatformVersion' parsing --- .../Microsoft.NET.TargetFrameworkInference.targets | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets index 07e579f5f38e..c4c940e378bf 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets @@ -65,6 +65,17 @@ Copyright (c) .NET Foundation. All rights reserved. $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 4)) + + + <_TargetPlatformVersionUsesCsWinRT3>false + <_TargetPlatformVersionUsesCsWinRT3 Condition="'$(TargetPlatformIdentifier)' == 'Windows' and $([System.Version]::Parse('$(TargetPlatformVersion)').Revision) == 1">true + $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 3)).0 + $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 2)) From c846395f9021bc2e41f2b0ea1b7a9e99693d0676 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 15 Jul 2025 11:14:30 -0700 Subject: [PATCH 6/9] Update targeting pack selection logic --- .../CreateWindowsSdkKnownFrameworkReferences.cs | 17 +++++++++++++++++ ...NET.Sdk.FrameworkReferenceResolution.targets | 1 + 2 files changed, 18 insertions(+) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/CreateWindowsSdkKnownFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/CreateWindowsSdkKnownFrameworkReferences.cs index 17138555aed9..0035cba55652 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/CreateWindowsSdkKnownFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/CreateWindowsSdkKnownFrameworkReferences.cs @@ -17,6 +17,8 @@ public class CreateWindowsSdkKnownFrameworkReferences : TaskBase { public bool UseWindowsSDKPreview { get; set; } + public bool UseCsWinRT3 { get; set; } + public string WindowsSdkPackageVersion { get; set; } public string TargetFrameworkIdentifier { get; set; } @@ -76,6 +78,21 @@ protected override void ExecuteCore() continue; } + // If we're using CsWinRT 3.0, filter to only items with '1' as the revision number. + // Otherwise, if we're using CsWinRT 2.0, exclude all of them and pick '0' revisions. + if ((UseCsWinRT3 && windowsSdkVersionParsed.Revision == 0) || + (!UseCsWinRT3 && windowsSdkVersionParsed.Revision == 1)) + { + continue; + } + + // Normalize the revision back to '0' now, as that matches the actual Windows SDK version + windowsSdkVersionParsed = new Version( + windowsSdkVersionParsed.Major, + windowsSdkVersionParsed.Minor, + windowsSdkVersionParsed.Build, + revision: 0); + if (!knownFrameworkReferencesByWindowsSdkVersion.ContainsKey(windowsSdkVersionParsed)) { knownFrameworkReferencesByWindowsSdkVersion[windowsSdkVersionParsed] = new(); diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets index 324d7a1ba638..3dd95435641b 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets @@ -39,6 +39,7 @@ Copyright (c) .NET Foundation. All rights reserved. Date: Tue, 15 Jul 2025 11:41:05 -0700 Subject: [PATCH 7/9] Update '_WarnForCsWinRT3_0PreviewFeatureEnabled' --- src/Tasks/Common/Resources/Strings.resx | 2 +- src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.de.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.es.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.it.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf | 4 ++-- .../targets/Microsoft.NET.TargetFrameworkInference.targets | 1 + .../targets/Microsoft.NET.Windows.targets | 6 +++--- 16 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx index bbebadd53f08..8aed4b94ce9d 100644 --- a/src/Tasks/Common/Resources/Strings.resx +++ b/src/Tasks/Common/Resources/Strings.resx @@ -995,7 +995,7 @@ You may need to build the project on another operating system or architecture, o {StrBegins="NETSDK1228: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index 4e5b591459c8..fe3e921ff434 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index 90c80bb7a38a..0c151084d8c2 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index 20107e912a1a..aa3c5856ccc4 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index ee09bd071ee5..1b7e006c246a 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index d161406ddd1d..27ca9b58959f 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index 3c93be7a54ce..91a272f49a58 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index 8a5420710946..e68af450895a 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index 3032f4c2e863..521ea58e1832 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index 80d63e09ccdf..fc8f98ca8e3e 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index 5c99f99a2821..9cdb65f4ad0c 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index 797e7819f3d4..c0524675930b 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index bc3a782cdc6b..2f7f53147b8b 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index 1c79bd08a394..2da21edb2171 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -1044,8 +1044,8 @@ The following are names of parameters or literal values and should not be transl {StrBegins="NETSDK1107: "} - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. - NETSDK1229: Targeting a Windows SDK version with '1' as the build number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the build number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. + NETSDK1229: Targeting a Windows SDK version with '1' as the revision number will reference CsWinRT 3.0, which is currently in preview. The current project is targeting the Windows SDK version '{0}'. If this is not intended, change the revision number to '0' to use CsWinRT 2.x instead. {StrBegins="NETSDK1229: "} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets index c4c940e378bf..8b2683f86ce3 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets @@ -74,6 +74,7 @@ Copyright (c) .NET Foundation. All rights reserved. --> <_TargetPlatformVersionUsesCsWinRT3>false <_TargetPlatformVersionUsesCsWinRT3 Condition="'$(TargetPlatformIdentifier)' == 'Windows' and $([System.Version]::Parse('$(TargetPlatformVersion)').Revision) == 1">true + <_OriginalWindowsTargetPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'Windows'">$(TargetPlatformVersion) $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 3)).0 $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 2)) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets index 2c126237bfa6..2ab077b6f382 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets @@ -169,14 +169,14 @@ Copyright (c) .NET Foundation. All rights reserved. + and '$(_TargetPlatformVersionUsesCsWinRT3)' == 'true' "> + FormatArguments="$(_OriginalWindowsTargetPlatformVersion)" /> From a979597df034eaf9ae1fb6850750d4a10cfc0fdd Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 16 Jul 2025 14:22:04 -0700 Subject: [PATCH 8/9] Define 'CSWINRT3_0' for CsWinRT 3.0 --- .../targets/Microsoft.NET.Sdk.BeforeCommon.targets | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets index 0b94c1b0cbb5..738de91b410b 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets @@ -211,6 +211,15 @@ Copyright (c) .NET Foundation. All rights reserved. <_ImplicitDefineConstant Include="$(_PlatformIdentifierForImplicitDefine)" /> <_ImplicitDefineConstant Include="$(_PlatformIdentifierForImplicitDefine)$(_PlatformVersionForImplicitDefine)" /> + + + + <_ImplicitDefineConstant Include="CSWINRT3_0" /> + From ded9963aeb6b1caebb5f24c5b40832b1bd4753aa Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 16 Jul 2025 14:24:32 -0700 Subject: [PATCH 9/9] Add unit tests --- ...ThatWeWantToBuildAWindowsDesktopProject.cs | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs index d8c129cf4e5a..3077f48aa4e9 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs @@ -498,6 +498,58 @@ public void ItWarnsWhenBuildingAProjectTargetingCsWinRT3_0() .NotHaveStdOutContaining("NETSDK1229"); } + [WindowsOnlyFact] + public void ItImplicitlyDefinesCSWINRT3_0WhenBuildingAProjectTargetingCsWinRT3_0() + { + TestProject testProject = new() + { + Name = "A", + ProjectSdk = "Microsoft.NET.Sdk", + TargetFrameworks = "net10.0-windows10.0.22621.1", + SourceFiles = + { + ["Program.cs"] = """ + #if !CSWINRT3_0 + #error CSWINRT3_0 is not defined + #endif + """ + } + }; + + var testAsset = _testAssetsManager.CreateTestProject(testProject); + + var buildCommand = new BuildCommand(testAsset); + buildCommand.Execute() + .Should() + .Pass(); + } + + [WindowsOnlyFact] + public void ItDoesNotImplicitlyDefineCSWINRT3_0WhenBuildingAProjectNotTargetingCsWinRT3_0() + { + TestProject testProject = new() + { + Name = "A", + ProjectSdk = "Microsoft.NET.Sdk", + TargetFrameworks = "net10.0-windows10.0.22621.0", + SourceFiles = + { + ["Program.cs"] = """ + #if CSWINRT3_0 + #error CSWINRT3_0 is defined + #endif + """ + } + }; + + var testAsset = _testAssetsManager.CreateTestProject(testProject); + + var buildCommand = new BuildCommand(testAsset); + buildCommand.Execute() + .Should() + .Pass(); + } + [WindowsOnlyFact] public void ItErrorsWhenTargetingBelowNet6WithUseUwpProperty() {