From 1e254534c4c2901fbcb13c7ad1cb3fd788c7aa1a Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 13 Nov 2025 18:04:39 +0000
Subject: [PATCH 1/5] Initial plan
From f8218873fe457c13884ccfe7c1540d6b8c320067 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 13 Nov 2025 18:23:20 +0000
Subject: [PATCH 2/5] Add deprecation warning for RoslynCompilerType=Framework
(NETSDK1234)
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
---
src/Tasks/Common/Resources/Strings.resx | 6 +-
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 +
.../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 +
.../Common/Resources/xlf/Strings.zh-Hans.xlf | 5 +
.../Common/Resources/xlf/Strings.zh-Hant.xlf | 5 +
....NET.RoslynCompilerTypeDeprecation.targets | 31 ++++
.../Microsoft.NET.Sdk.BeforeCommon.targets | 3 +
...antToDetectDeprecatedRoslynCompilerType.cs | 171 ++++++++++++++++++
17 files changed, 275 insertions(+), 1 deletion(-)
create mode 100644 src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets
create mode 100644 test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx
index 518abb95d3de..95da113e6b54 100644
--- a/src/Tasks/Common/Resources/Strings.resx
+++ b/src/Tasks/Common/Resources/Strings.resx
@@ -1010,5 +1010,9 @@ You may need to build the project on another operating system or architecture, o
NETSDK1233: Targeting .NET 10.0 or higher in Visual Studio 2022 17.14 is not supported.{StrBegins="NETSDK1233: "}
-
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+
+
diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
index b3150ec53b65..40005f83225e 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: Nastavení RollForward je podporováno pouze pro .NET Core 3.0 nebo vyšší.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: Soubor {0} neexistuje. Ujistěte se prosím, že cesta ke grafu modulu runtime existuje.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf
index 2d96be400f70..19d8939691e9 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: Die RollForward-Einstellung wird nur für .NET Core 3.0 oder höher unterstützt.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: Die Datei „{0}“ existiert nicht. Stellen Sie sicher, dass der Pfad zum Runtimegraph vorhanden ist.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf
index c809c4172947..9e25e89d22dd 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: La configuración de RollForward solo se admite en .NET Core 3.0 o versiones posteriores.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: el archivo "{0}" no existe. Asegúrese de que la ruta de acceso del grafo en tiempo de ejecución existe.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
index 4f8f47200d1c..110389e6313a 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: le paramètre RollForward est uniquement pris en charge sur .NET Core 3.0 ou version ultérieure.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: le fichier « {0} » n’existe pas. Veuillez vérifier que le chemin d’accès du graphique d’exécution existe.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf
index 6f47775c6a67..57c235b87d93 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: l'impostazione RollForward è supportata solo in .NET Core 3.0 o versione successiva.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: il file '{0}' non esiste. Verificare che il percorso del grafo del runtime esista.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
index 03fb4261129c..cec50606b534 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: ロールフォワードの設定は、.NET Core 3.0 以降でのみサポートされています。{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: ファイル '{0}' は存在しません。ランタイム グラフ パスが存在することを確認してください。
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
index 367083c96234..420cf8e38343 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: RollForward 설정은 .NET Core 3.0 이상에서만 지원됩니다.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: '{0}' 파일이 없습니다. 런타임 그래프 경로가 있는지 확인하세요.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
index 9ae273652d32..2cabe3ab9dd4 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: Ustawienie RollForward jest obsługiwane tylko w programie .NET Core 3.0 lub nowszym.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: plik „{0}” nie istnieje. Upewnij się, że ścieżka grafu środowiska uruchomieniowego istnieje.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
index e5dd12698ed0..2436d39a73d9 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: só há suporte para a configuração RollForward no .NET Core 3.0 ou superior.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: O arquivo '{0}' não existe. Certifique-se de que o caminho do grafo de runtime exista.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
index 80990c05eb42..2ea90ea8b432 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: параметр RollForward поддерживается только в .NET Core 3.0 или более поздних версий.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: файл "{0}" не существует. Убедитесь, что путь к графу среды выполнения существует.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
index 3d5a18e84483..fd84ca3cdece 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: RollForward ayarı yalnızca .NET Core 3.0 veya üzeri sürümlerde desteklenir.{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: '{0}' dosyası mevcut değil. Lütfen çalışma zamanı grafiği yolunun var olduğundan emin olun.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
index 4724120c66ed..65c6936db553 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: RollForward 设置仅在 .NET Core 3.0 或更高版本上受支持。{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: 文件 "{0}" 不存在。请确保运行时图形路径存在。
diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
index 9d8d0bf09817..c171b359a7fc 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
@@ -861,6 +861,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1103: 僅於 .NET Core 3.0 或更新版本支援 RollForward 設定。{StrBegins="NETSDK1103: "}
+
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
+ {StrBegins="NETSDK1234: "}
+ NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.NETSDK1231: 檔案 '{0}' 不存在。請確認執行階段圖形路徑是否存在。
diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets
new file mode 100644
index 000000000000..e954e65b73e6
--- /dev/null
+++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
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 ce9388ef9976..816c2b87ffda 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
@@ -87,6 +87,9 @@ Copyright (c) .NET Foundation. All rights reserved.
+
+
+
<_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true
diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
new file mode 100644
index 000000000000..cb90f64aa15a
--- /dev/null
+++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
@@ -0,0 +1,171 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#nullable disable
+
+namespace Microsoft.NET.Build.Tests
+{
+ public class GivenThatWeWantToDetectDeprecatedRoslynCompilerType : SdkTest
+ {
+ public GivenThatWeWantToDetectDeprecatedRoslynCompilerType(ITestOutputHelper log) : base(log)
+ {
+ }
+
+ [Fact]
+ public void It_warns_when_RoslynCompilerType_is_Framework()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "DeprecatedRoslynCompilerType",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
+
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
+
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+
+ var result = buildCommand
+ .Execute();
+
+ result
+ .Should()
+ .Pass()
+ .And
+ .HaveStdOutContaining("NETSDK1234")
+ .And
+ .HaveStdOutContaining("RoslynCompilerType 'Framework' is deprecated");
+ }
+
+ [Fact]
+ public void It_does_not_warn_when_RoslynCompilerType_is_Core()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "RoslynCompilerTypeCore",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
+
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Core";
+
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+
+ var result = buildCommand
+ .Execute();
+
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
+
+ [Fact]
+ public void It_does_not_warn_when_RoslynCompilerType_is_FrameworkPackage()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "RoslynCompilerTypeFrameworkPackage",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
+
+ testProject.AdditionalProperties["RoslynCompilerType"] = "FrameworkPackage";
+
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+
+ var result = buildCommand
+ .Execute();
+
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
+
+ [Fact]
+ public void It_does_not_warn_when_RoslynCompilerType_is_not_set()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "RoslynCompilerTypeNotSet",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
+
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+
+ var result = buildCommand
+ .Execute();
+
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
+
+ [Fact]
+ public void It_does_not_warn_when_suppressed_with_NoWarn()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "RoslynCompilerTypeNoWarn",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
+
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
+ testProject.AdditionalProperties["NoWarn"] = "NETSDK1234";
+
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+
+ var result = buildCommand
+ .Execute();
+
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
+
+ [Fact]
+ public void It_can_suppress_warning_via_command_line()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "RoslynCompilerTypeNoWarnCmdLine",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
+
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
+
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+
+ var result = buildCommand
+ .Execute("/p:NoWarn=NETSDK1234");
+
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
+ }
+}
From 5006db75ff4da88089efdac26b4b302444c80d4b Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 14 Nov 2025 10:48:08 +0000
Subject: [PATCH 3/5] Address PR feedback: inline target, update URL, fix test
code style
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
---
src/Tasks/Common/Resources/Strings.resx | 2 +-
src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.de.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.es.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.it.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 2 +-
.../Common/Resources/xlf/Strings.pt-BR.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 2 +-
src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 2 +-
.../Common/Resources/xlf/Strings.zh-Hans.xlf | 2 +-
.../Common/Resources/xlf/Strings.zh-Hant.xlf | 2 +-
....NET.RoslynCompilerTypeDeprecation.targets | 31 ---
.../Microsoft.NET.Sdk.BeforeCommon.targets | 11 +-
...antToDetectDeprecatedRoslynCompilerType.cs | 237 +++++++++---------
17 files changed, 137 insertions(+), 170 deletions(-)
delete mode 100644 src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets
diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx
index 95da113e6b54..923913bd1f06 100644
--- a/src/Tasks/Common/Resources/Strings.resx
+++ b/src/Tasks/Common/Resources/Strings.resx
@@ -1012,7 +1012,7 @@ You may need to build the project on another operating system or architecture, o
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
index 40005f83225e..e2843aabc896 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf
index 19d8939691e9..739552850863 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf
index 9e25e89d22dd..05d896c73eec 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
index 110389e6313a..1e2cb7d74a04 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf
index 57c235b87d93..79345cbc5e59 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
index cec50606b534..d59ebf7e4b24 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
index 420cf8e38343..5d65dcc1a4f9 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
index 2cabe3ab9dd4..ad7d52f9f803 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
index 2436d39a73d9..2d944e7b5097 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
index 2ea90ea8b432..8c38a2f4519c 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
index fd84ca3cdece..a8e1b13f931a 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
index 65c6936db553..05fa79d313cf 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
index c171b359a7fc..6ed44c157d07 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
@@ -864,7 +864,7 @@ The following are names of parameters or literal values and should not be transl
NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.NETSDK1234: RoslynCompilerType 'Framework' is deprecated and will be removed in a future version. Please refer to {0} for more information.
- {StrBegins="NETSDK1234: "}
+ {StrBegins="NETSDK1234: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}NETSDK1231: File '{0}' does not exist. Please ensure the runtime graph path exists.
diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets
deleted file mode 100644
index e954e65b73e6..000000000000
--- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RoslynCompilerTypeDeprecation.targets
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
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 816c2b87ffda..ea885e204436 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
@@ -87,9 +87,6 @@ Copyright (c) .NET Foundation. All rights reserved.
-
-
-
<_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true
@@ -364,6 +361,14 @@ Copyright (c) .NET Foundation. All rights reserved.
+
+
+
+
+
diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
index cb90f64aa15a..9b5e8afc5ee1 100644
--- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
+++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
@@ -3,169 +3,162 @@
#nullable disable
-namespace Microsoft.NET.Build.Tests
+namespace Microsoft.NET.Build.Tests;
+
+public sealed class GivenThatWeWantToDetectDeprecatedRoslynCompilerType(ITestOutputHelper log) : SdkTest(log)
{
- public class GivenThatWeWantToDetectDeprecatedRoslynCompilerType : SdkTest
+ [Fact]
+ public void It_warns_when_RoslynCompilerType_is_Framework()
{
- public GivenThatWeWantToDetectDeprecatedRoslynCompilerType(ITestOutputHelper log) : base(log)
- {
- }
-
- [Fact]
- public void It_warns_when_RoslynCompilerType_is_Framework()
+ var testProject = new TestProject()
{
- var testProject = new TestProject()
- {
- Name = "DeprecatedRoslynCompilerType",
- TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
- IsExe = true
- };
+ Name = "DeprecatedRoslynCompilerType",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
- testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
- var testAsset = _testAssetsManager.CreateTestProject(testProject);
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
- var buildCommand = new BuildCommand(testAsset);
+ var buildCommand = new BuildCommand(testAsset);
- var result = buildCommand
- .Execute();
+ var result = buildCommand
+ .Execute();
- result
- .Should()
- .Pass()
- .And
- .HaveStdOutContaining("NETSDK1234")
- .And
- .HaveStdOutContaining("RoslynCompilerType 'Framework' is deprecated");
- }
+ result
+ .Should()
+ .Pass()
+ .And
+ .HaveStdOutContaining("NETSDK1234");
+ }
- [Fact]
- public void It_does_not_warn_when_RoslynCompilerType_is_Core()
+ [Fact]
+ public void It_does_not_warn_when_RoslynCompilerType_is_Core()
+ {
+ var testProject = new TestProject()
{
- var testProject = new TestProject()
- {
- Name = "RoslynCompilerTypeCore",
- TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
- IsExe = true
- };
+ Name = "RoslynCompilerTypeCore",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
- testProject.AdditionalProperties["RoslynCompilerType"] = "Core";
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Core";
- var testAsset = _testAssetsManager.CreateTestProject(testProject);
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
- var buildCommand = new BuildCommand(testAsset);
+ var buildCommand = new BuildCommand(testAsset);
- var result = buildCommand
- .Execute();
+ var result = buildCommand
+ .Execute();
- result
- .Should()
- .Pass()
- .And
- .NotHaveStdOutContaining("NETSDK1234");
- }
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
- [Fact]
- public void It_does_not_warn_when_RoslynCompilerType_is_FrameworkPackage()
+ [Fact]
+ public void It_does_not_warn_when_RoslynCompilerType_is_FrameworkPackage()
+ {
+ var testProject = new TestProject()
{
- var testProject = new TestProject()
- {
- Name = "RoslynCompilerTypeFrameworkPackage",
- TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
- IsExe = true
- };
+ Name = "RoslynCompilerTypeFrameworkPackage",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
- testProject.AdditionalProperties["RoslynCompilerType"] = "FrameworkPackage";
+ testProject.AdditionalProperties["RoslynCompilerType"] = "FrameworkPackage";
- var testAsset = _testAssetsManager.CreateTestProject(testProject);
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
- var buildCommand = new BuildCommand(testAsset);
+ var buildCommand = new BuildCommand(testAsset);
- var result = buildCommand
- .Execute();
+ var result = buildCommand
+ .Execute();
- result
- .Should()
- .Pass()
- .And
- .NotHaveStdOutContaining("NETSDK1234");
- }
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
- [Fact]
- public void It_does_not_warn_when_RoslynCompilerType_is_not_set()
+ [Fact]
+ public void It_does_not_warn_when_RoslynCompilerType_is_not_set()
+ {
+ var testProject = new TestProject()
{
- var testProject = new TestProject()
- {
- Name = "RoslynCompilerTypeNotSet",
- TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
- IsExe = true
- };
+ Name = "RoslynCompilerTypeNotSet",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
- var testAsset = _testAssetsManager.CreateTestProject(testProject);
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
- var buildCommand = new BuildCommand(testAsset);
+ var buildCommand = new BuildCommand(testAsset);
- var result = buildCommand
- .Execute();
+ var result = buildCommand
+ .Execute();
- result
- .Should()
- .Pass()
- .And
- .NotHaveStdOutContaining("NETSDK1234");
- }
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
- [Fact]
- public void It_does_not_warn_when_suppressed_with_NoWarn()
+ [Fact]
+ public void It_does_not_warn_when_suppressed_with_NoWarn()
+ {
+ var testProject = new TestProject()
{
- var testProject = new TestProject()
- {
- Name = "RoslynCompilerTypeNoWarn",
- TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
- IsExe = true
- };
+ Name = "RoslynCompilerTypeNoWarn",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
- testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
- testProject.AdditionalProperties["NoWarn"] = "NETSDK1234";
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
+ testProject.AdditionalProperties["NoWarn"] = "NETSDK1234";
- var testAsset = _testAssetsManager.CreateTestProject(testProject);
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
- var buildCommand = new BuildCommand(testAsset);
+ var buildCommand = new BuildCommand(testAsset);
- var result = buildCommand
- .Execute();
+ var result = buildCommand
+ .Execute();
- result
- .Should()
- .Pass()
- .And
- .NotHaveStdOutContaining("NETSDK1234");
- }
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
+ }
- [Fact]
- public void It_can_suppress_warning_via_command_line()
+ [Fact]
+ public void It_can_suppress_warning_via_command_line()
+ {
+ var testProject = new TestProject()
{
- var testProject = new TestProject()
- {
- Name = "RoslynCompilerTypeNoWarnCmdLine",
- TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
- IsExe = true
- };
+ Name = "RoslynCompilerTypeNoWarnCmdLine",
+ TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
+ IsExe = true
+ };
- testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
+ testProject.AdditionalProperties["RoslynCompilerType"] = "Framework";
- var testAsset = _testAssetsManager.CreateTestProject(testProject);
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
- var buildCommand = new BuildCommand(testAsset);
+ var buildCommand = new BuildCommand(testAsset);
- var result = buildCommand
- .Execute("/p:NoWarn=NETSDK1234");
+ var result = buildCommand
+ .Execute("/p:NoWarn=NETSDK1234");
- result
- .Should()
- .Pass()
- .And
- .NotHaveStdOutContaining("NETSDK1234");
- }
+ result
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining("NETSDK1234");
}
}
From 8ad99ab46d3d5675e8ac17ab7c2c28a4f030ba2e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 14 Nov 2025 13:13:30 +0000
Subject: [PATCH 4/5] Fix test to search for " NETSDK1234" to avoid matching
command line args
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
---
...ThatWeWantToDetectDeprecatedRoslynCompilerType.cs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
index 9b5e8afc5ee1..0d757af935c8 100644
--- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
+++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
@@ -30,7 +30,7 @@ public void It_warns_when_RoslynCompilerType_is_Framework()
.Should()
.Pass()
.And
- .HaveStdOutContaining("NETSDK1234");
+ .HaveStdOutContaining(" NETSDK1234");
}
[Fact]
@@ -56,7 +56,7 @@ public void It_does_not_warn_when_RoslynCompilerType_is_Core()
.Should()
.Pass()
.And
- .NotHaveStdOutContaining("NETSDK1234");
+ .NotHaveStdOutContaining(" NETSDK1234");
}
[Fact]
@@ -82,7 +82,7 @@ public void It_does_not_warn_when_RoslynCompilerType_is_FrameworkPackage()
.Should()
.Pass()
.And
- .NotHaveStdOutContaining("NETSDK1234");
+ .NotHaveStdOutContaining(" NETSDK1234");
}
[Fact]
@@ -106,7 +106,7 @@ public void It_does_not_warn_when_RoslynCompilerType_is_not_set()
.Should()
.Pass()
.And
- .NotHaveStdOutContaining("NETSDK1234");
+ .NotHaveStdOutContaining(" NETSDK1234");
}
[Fact]
@@ -133,7 +133,7 @@ public void It_does_not_warn_when_suppressed_with_NoWarn()
.Should()
.Pass()
.And
- .NotHaveStdOutContaining("NETSDK1234");
+ .NotHaveStdOutContaining(" NETSDK1234");
}
[Fact]
@@ -159,6 +159,6 @@ public void It_can_suppress_warning_via_command_line()
.Should()
.Pass()
.And
- .NotHaveStdOutContaining("NETSDK1234");
+ .NotHaveStdOutContaining(" NETSDK1234");
}
}
From 4446d41cc3bbbb937f8fc17f191bc5df24bc2509 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 18 Nov 2025 12:52:29 +0000
Subject: [PATCH 5/5] Change GitHub link to aka.ms shortlink for consistency
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
---
.../targets/Microsoft.NET.Sdk.BeforeCommon.targets | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 ea885e204436..bf63f005881b 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
@@ -366,7 +366,7 @@ Copyright (c) .NET Foundation. All rights reserved.
BeforeTargets="PrepareForBuild"
Condition="'$(RoslynCompilerType)' == 'Framework'">
+ FormatArguments="https://aka.ms/roslyn-compiler-type-framework" />