diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx
index 518abb95d3de..923913bd1f06 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: "}{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 b3150ec53b65..e2843aabc896 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..739552850863 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..05d896c73eec 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..1e2cb7d74a04 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..79345cbc5e59 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..d59ebf7e4b24 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..5d65dcc1a4f9 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..ad7d52f9f803 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..2d944e7b5097 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..8c38a2f4519c 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..a8e1b13f931a 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..05fa79d313cf 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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..6ed44c157d07 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: "}{Locked="RoslynCompilerType"}{Locked="Framework"}{Locked="{0}"}
+ 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.Sdk.BeforeCommon.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets
index ce9388ef9976..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
@@ -361,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
new file mode 100644
index 000000000000..0d757af935c8
--- /dev/null
+++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToDetectDeprecatedRoslynCompilerType.cs
@@ -0,0 +1,164 @@
+// 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 sealed class GivenThatWeWantToDetectDeprecatedRoslynCompilerType(ITestOutputHelper log) : SdkTest(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");
+ }
+
+ [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");
+ }
+}