diff --git a/eng/restore-toolset.ps1 b/eng/restore-toolset.ps1
index c4278736e3e8..5641f7dd29a6 100644
--- a/eng/restore-toolset.ps1
+++ b/eng/restore-toolset.ps1
@@ -1,6 +1,6 @@
function InitializeCustomSDKToolset {
if ($env:TestFullMSBuild -eq "true") {
- $env:DOTNET_SDK_TEST_MSBUILD_PATH = InitializeVisualStudioMSBuild -install:$false -vsRequirements:$GlobalJson.tools.'vs-opt'
+ $env:DOTNET_SDK_TEST_MSBUILD_PATH = InitializeVisualStudioMSBuild -install:$true -vsRequirements:$GlobalJson.tools.'vs-opt'
Write-Host "INFO: Tests will run against full MSBuild in $env:DOTNET_SDK_TEST_MSBUILD_PATH"
}
diff --git a/global.json b/global.json
index 69fa6d3e7f7a..07a5ac26bc5b 100644
--- a/global.json
+++ b/global.json
@@ -7,8 +7,9 @@
]
},
"vs-opt": {
- "version": "15.9"
- }
+ "version": "16.8"
+ },
+ "xcopy-msbuild": "16.8.0-preview2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20374.1",
diff --git a/src/Assets/TestProjects/TestAppWithLaunchSettings/Program.cs b/src/Assets/TestProjects/TestAppWithLaunchSettings/Program.cs
new file mode 100644
index 000000000000..6292216dd517
--- /dev/null
+++ b/src/Assets/TestProjects/TestAppWithLaunchSettings/Program.cs
@@ -0,0 +1,16 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+
+namespace ConsoleApplication
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ Console.WriteLine("Hello world");
+ Console.WriteLine($"MyCoolEnvironmentVariableKey={Environment.GetEnvironmentVariable("MyCoolEnvironmentVariableKey")}");
+ }
+ }
+}
diff --git a/src/Assets/TestProjects/TestAppWithLaunchSettings/Properties/launchSettings.json b/src/Assets/TestProjects/TestAppWithLaunchSettings/Properties/launchSettings.json
new file mode 100644
index 000000000000..d9381bec04f0
--- /dev/null
+++ b/src/Assets/TestProjects/TestAppWithLaunchSettings/Properties/launchSettings.json
@@ -0,0 +1,11 @@
+{
+ "profiles": {
+ "TestAppWithLaunchSettings": {
+ "commandName": "Project",
+ "dotnetRunMessages": "true",
+ "environmentVariables": {
+ "MyCoolEnvironmentVariableKey": "MyCoolEnvironmentVariableValue"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Assets/TestProjects/TestAppWithLaunchSettings/TestAppWithLaunchSettings.csproj b/src/Assets/TestProjects/TestAppWithLaunchSettings/TestAppWithLaunchSettings.csproj
new file mode 100644
index 000000000000..1319a1bcba1f
--- /dev/null
+++ b/src/Assets/TestProjects/TestAppWithLaunchSettings/TestAppWithLaunchSettings.csproj
@@ -0,0 +1,8 @@
+
+
+
+
+ netcoreapp3.0
+ Exe
+
+
\ No newline at end of file
diff --git a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ILaunchSettingsProvider.cs b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ILaunchSettingsProvider.cs
index 681daee24a98..0b0e8bdc108d 100644
--- a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ILaunchSettingsProvider.cs
+++ b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ILaunchSettingsProvider.cs
@@ -5,9 +5,7 @@ namespace Microsoft.DotNet.Tools.Run.LaunchSettings
{
internal interface ILaunchSettingsProvider
{
- string CommandName { get; }
-
- LaunchSettingsApplyResult TryApplySettings(JsonElement model, ref ICommand command);
+ LaunchSettingsApplyResult TryGetLaunchSettings(JsonElement model);
}
}
diff --git a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsApplyResult.cs b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsApplyResult.cs
index 04b9dca3be3b..983faa214605 100644
--- a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsApplyResult.cs
+++ b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsApplyResult.cs
@@ -1,18 +1,21 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
namespace Microsoft.DotNet.Tools.Run.LaunchSettings
{
public class LaunchSettingsApplyResult
{
- public LaunchSettingsApplyResult(bool success, string failureReason, string runAfterLaunch = null)
+ public LaunchSettingsApplyResult(bool success, string failureReason, ProjectLaunchSettingsModel launchSettings = null)
{
Success = success;
FailureReason = failureReason;
- RunAfterLaunch = runAfterLaunch;
+ LaunchSettings = launchSettings;
}
public bool Success { get; }
public string FailureReason { get; }
- public string RunAfterLaunch { get; }
+ public ProjectLaunchSettingsModel LaunchSettings { get; }
}
}
diff --git a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs
index d8f4b5f3c276..1b7bd802c76a 100644
--- a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs
+++ b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs
@@ -1,4 +1,7 @@
-using System;
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
@@ -21,7 +24,7 @@ static LaunchSettingsManager()
};
}
- public static LaunchSettingsApplyResult TryApplyLaunchSettings(string launchSettingsJsonContents, ref ICommand command, string profileName = null)
+ public static LaunchSettingsApplyResult TryApplyLaunchSettings(string launchSettingsJsonContents, string profileName = null)
{
try
{
@@ -90,7 +93,7 @@ public static LaunchSettingsApplyResult TryApplyLaunchSettings(string launchSett
return new LaunchSettingsApplyResult(false, string.Format(LocalizableStrings.LaunchProfileHandlerCannotBeLocated, commandName));
}
- return provider.TryApplySettings(profileObject, ref command);
+ return provider.TryGetLaunchSettings(profileObject);
}
}
catch (JsonException ex)
diff --git a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsModel.cs b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsModel.cs
new file mode 100644
index 000000000000..df50d702ba90
--- /dev/null
+++ b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsModel.cs
@@ -0,0 +1,23 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Collections.Generic;
+
+namespace Microsoft.DotNet.Tools.Run.LaunchSettings
+{
+ public class ProjectLaunchSettingsModel
+ {
+ public string CommandLineArgs { get; set; }
+
+ public bool LaunchBrowser { get; set; }
+
+ public string LaunchUrl { get; set; }
+
+ public string ApplicationUrl { get; set; }
+
+ public string DotNetRunMessages { get; set; }
+
+ public Dictionary EnvironmentVariables { get; } = new Dictionary(StringComparer.Ordinal);
+ }
+}
diff --git a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs
index 52f86b4db845..e93e01c17be2 100644
--- a/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs
+++ b/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs
@@ -1,7 +1,8 @@
-using System;
-using System.Collections.Generic;
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
using System.Text.Json;
-using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Run.LaunchSettings
{
@@ -11,7 +12,7 @@ internal class ProjectLaunchSettingsProvider : ILaunchSettingsProvider
public string CommandName => CommandNameValue;
- public LaunchSettingsApplyResult TryApplySettings(JsonElement model, ref ICommand command)
+ public LaunchSettingsApplyResult TryGetLaunchSettings(JsonElement model)
{
var config = new ProjectLaunchSettingsModel();
foreach (var property in model.EnumerateObject())
@@ -52,6 +53,15 @@ public LaunchSettingsApplyResult TryApplySettings(JsonElement model, ref IComman
config.ApplicationUrl = applicationUrlValue;
}
+ else if (string.Equals(property.Name, nameof(ProjectLaunchSettingsModel.DotNetRunMessages), StringComparison.OrdinalIgnoreCase))
+ {
+ if (!TryGetStringValue(property.Value, out var dotNetRunMessages))
+ {
+ return new LaunchSettingsApplyResult(false, string.Format(LocalizableStrings.CouldNotConvertToString, property.Name));
+ }
+
+ config.DotNetRunMessages = dotNetRunMessages;
+ }
else if (string.Equals(property.Name, nameof(ProjectLaunchSettingsModel.EnvironmentVariables), StringComparison.OrdinalIgnoreCase))
{
if (property.Value.ValueKind != JsonValueKind.Object)
@@ -59,7 +69,7 @@ public LaunchSettingsApplyResult TryApplySettings(JsonElement model, ref IComman
return new LaunchSettingsApplyResult(false, string.Format(LocalizableStrings.ValueMustBeAnObject, property.Name));
}
- foreach(var environmentVariable in property.Value.EnumerateObject())
+ foreach (var environmentVariable in property.Value.EnumerateObject())
{
if (TryGetStringValue(environmentVariable.Value, out var environmentVariableValue))
{
@@ -69,21 +79,7 @@ public LaunchSettingsApplyResult TryApplySettings(JsonElement model, ref IComman
}
}
- if (!string.IsNullOrEmpty(config.ApplicationUrl))
- {
- command.EnvironmentVariable("ASPNETCORE_URLS", config.ApplicationUrl);
- }
-
- //For now, ignore everything but the environment variables section
-
- foreach (var entry in config.EnvironmentVariables)
- {
- string value = Environment.ExpandEnvironmentVariables(entry.Value);
- //NOTE: MSBuild variables are not expanded like they are in VS
- command.EnvironmentVariable(entry.Key, value);
- }
-
- return new LaunchSettingsApplyResult(true, null, config.LaunchUrl);
+ return new LaunchSettingsApplyResult(true, null, config);
}
private static bool TryGetBooleanValue(JsonElement element, out bool value)
@@ -136,23 +132,5 @@ private static bool TryGetStringValue(JsonElement element, out string value)
return false;
}
}
-
- private class ProjectLaunchSettingsModel
- {
- public ProjectLaunchSettingsModel()
- {
- EnvironmentVariables = new Dictionary(StringComparer.Ordinal);
- }
-
- public string CommandLineArgs { get; set; }
-
- public bool LaunchBrowser { get; set; }
-
- public string LaunchUrl { get; set; }
-
- public string ApplicationUrl { get; set; }
-
- public Dictionary EnvironmentVariables { get; }
- }
}
}
diff --git a/src/Cli/dotnet/commands/dotnet-run/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-run/LocalizableStrings.resx
index 24c591290b4d..59f9d4b94494 100644
--- a/src/Cli/dotnet/commands/dotnet-run/LocalizableStrings.resx
+++ b/src/Cli/dotnet/commands/dotnet-run/LocalizableStrings.resx
@@ -147,6 +147,9 @@
The target runtime to run for.
+
+ Building...
+
The build failed. Fix the build errors and run again.
@@ -214,4 +217,4 @@ The current {1} is '{2}'.
The property '{0}' must be an object if it is specified.
-
\ No newline at end of file
+
diff --git a/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs b/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs
index 1bd02d65e6b5..7c54dc4cbfd6 100644
--- a/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs
+++ b/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs
@@ -8,8 +8,6 @@
using Microsoft.Build.Execution;
using Microsoft.Build.Exceptions;
using Microsoft.DotNet.Cli.Utils;
-using Microsoft.DotNet.Tools;
-using Microsoft.DotNet.Tools.MSBuild;
using Microsoft.DotNet.Tools.Run.LaunchSettings;
using Microsoft.DotNet.CommandFactory;
@@ -41,17 +39,37 @@ public int Execute()
{
Initialize();
+ if (!TryGetLaunchProfileSettingsIfNeeded(out var launchSettings))
+ {
+ return 1;
+ }
+
if (ShouldBuild)
{
+ if (string.Equals("true", launchSettings?.DotNetRunMessages, StringComparison.OrdinalIgnoreCase))
+ {
+ Reporter.Output.WriteLine(LocalizableStrings.RunCommandBuilding);
+ }
+
EnsureProjectIsBuilt();
}
try
{
ICommand targetCommand = GetTargetCommand();
- if (!ApplyLaunchProfileSettingsIfNeeded(ref targetCommand))
+ if (launchSettings != null)
{
- return 1;
+ if (!string.IsNullOrEmpty(launchSettings.ApplicationUrl))
+ {
+ targetCommand.EnvironmentVariable("ASPNETCORE_URLS", launchSettings.ApplicationUrl);
+ }
+
+ foreach (var entry in launchSettings.EnvironmentVariables)
+ {
+ string value = Environment.ExpandEnvironmentVariables(entry.Value);
+ //NOTE: MSBuild variables are not expanded like they are in VS
+ targetCommand.EnvironmentVariable(entry.Key, value);
+ }
}
// Ignore Ctrl-C for the remainder of the command's execution
@@ -92,8 +110,9 @@ public RunCommand(string configuration,
Interactive = interactive;
}
- private bool ApplyLaunchProfileSettingsIfNeeded(ref ICommand targetCommand)
+ private bool TryGetLaunchProfileSettingsIfNeeded(out ProjectLaunchSettingsModel launchSettingsModel)
{
+ launchSettingsModel = default;
if (!UseLaunchProfile)
{
return true;
@@ -117,7 +136,8 @@ private bool ApplyLaunchProfileSettingsIfNeeded(ref ICommand targetCommand)
if (File.Exists(launchSettingsPath))
{
- if (!HasQuietVerbosity) {
+ if (!HasQuietVerbosity)
+ {
Reporter.Output.WriteLine(string.Format(LocalizableStrings.UsingLaunchSettingsFromMessage, launchSettingsPath));
}
@@ -126,11 +146,15 @@ private bool ApplyLaunchProfileSettingsIfNeeded(ref ICommand targetCommand)
try
{
var launchSettingsFileContents = File.ReadAllText(launchSettingsPath);
- var applyResult = LaunchSettingsManager.TryApplyLaunchSettings(launchSettingsFileContents, ref targetCommand, LaunchProfile);
+ var applyResult = LaunchSettingsManager.TryApplyLaunchSettings(launchSettingsFileContents, LaunchProfile);
if (!applyResult.Success)
{
Reporter.Error.WriteLine(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, profileName, applyResult.FailureReason).Bold().Red());
}
+ else
+ {
+ launchSettingsModel = applyResult.LaunchSettings;
+ }
}
catch (IOException ex)
{
@@ -155,7 +179,7 @@ private void EnsureProjectIsBuilt()
new RestoringCommand(
restoreArgs.Prepend(Project),
restoreArgs,
- new [] { Project },
+ new[] { Project },
NoRestore
).Execute();
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf
index 3d4b5a0bfbbd..4db4cc36cc5b 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf
@@ -32,6 +32,11 @@
Hodnotu vlastnosti {0} nejde převést na řetězec.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.Sestavení se nepovedlo. Opravte v sestavení chyby a spusťte ho znovu.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf
index 894850a8306a..44fd789c877d 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf
@@ -32,6 +32,11 @@
Der Wert der Eigenschaft "{0}" konnte nicht in eine Zeichenfolge konvertiert werden.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.Fehler beim Buildvorgang. Beheben Sie die Buildfehler, und versuchen Sie es anschließend noch mal.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf
index b0f5cfd3adc8..3fdd4adb282c 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf
@@ -32,6 +32,11 @@
No se pudo convertir el valor de la propiedad "{0}" en una cadena.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.No se pudo llevar a cabo la compilación. Corrija los errores de compilación y vuelva a ejecutar el proyecto.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf
index efd4b5464273..454b69ba74b0 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf
@@ -32,6 +32,11 @@
Impossible de convertir la valeur de la propriété '{0}' en chaîne.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.La build a échoué. Corrigez les erreurs de la build et réexécutez-la.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf
index a50fd3663ea2..a6c18ea6b1f6 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf
@@ -32,6 +32,11 @@
Non è stato possibile convertire il valore della proprietà '{0}' in una stringa.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.La compilazione non è riuscita. Correggere gli errori di compilazione e ripetere l'esecuzione.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf
index f43c361d0475..39c8e8d6632c 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf
@@ -32,6 +32,11 @@
プロパティ '{0}' の値を文字列に変換できませんでした。
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.ビルドに失敗しました。ビルド エラーを修正して、もう一度実行してください。
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf
index 0a141e6b14b1..6bce6cdf9a98 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf
@@ -32,6 +32,11 @@
'{0}' 속성 값을 문자열로 변환할 수 없습니다.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.빌드하지 못했습니다. 빌드 오류를 수정하고 다시 실행하세요.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf
index 1f196db2c3ea..f7d703ccba64 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf
@@ -32,6 +32,11 @@
Nie można przekonwertować wartości właściwości „{0}” na ciąg.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.Kompilacja nie powiodła się. Napraw błędy kompilacji i uruchom ją ponownie.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf
index eaf3313d4271..c2ad38c4d521 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf
@@ -32,6 +32,11 @@
Não foi possível converter o valor da propriedade '{0}' em uma cadeia de caracteres.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.Ocorreu uma falha no build. Corrija os erros de build e execute novamente.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf
index ae48a6218aa2..3aad37723a9a 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf
@@ -32,6 +32,11 @@
Не удалось преобразовать значение свойства "{0}" в строку.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.Ошибка сборки. Устраните ошибки сборки и повторите попытку.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf
index b15f6a6ec8d8..eac14f47d350 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf
@@ -32,6 +32,11 @@
'{0}' özelliğinin değeri dizeye dönüştürülemedi.
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.Derleme başarısız oldu. Derleme hatalarını düzeltip yeniden çalıştırın.
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf
index d29d59941f4a..a53e764a4d99 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf
@@ -32,6 +32,11 @@
无法将属性“{0}”的值转换为字符串。
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.生成失败。请修复生成错误并重新运行。
diff --git a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf
index 1e96ecaa985e..c3a6053a9615 100644
--- a/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf
+++ b/src/Cli/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf
@@ -32,6 +32,11 @@
無法將屬性 '{0}' 的值轉換為字串。
+
+ Building...
+ Building...
+
+ The build failed. Fix the build errors and run again.建置失敗。請修正建置錯誤後,再執行一次。
diff --git a/src/Layout/redist/minimumMSBuildVersion b/src/Layout/redist/minimumMSBuildVersion
index 2e4239c31313..93eef160e899 100644
--- a/src/Layout/redist/minimumMSBuildVersion
+++ b/src/Layout/redist/minimumMSBuildVersion
@@ -1 +1 @@
-16.7.0
+16.8.0
diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx
index 2e42017880b4..243affd6b99c 100644
--- a/src/Tasks/Common/Resources/Strings.resx
+++ b/src/Tasks/Common/Resources/Strings.resx
@@ -657,4 +657,13 @@ The following are names of parameters or literal values and should not be transl
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.{StrBegin="NETSDK1138: "}
-
\ No newline at end of file
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+
+
diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
index cb10b3275430..96834b6e0b5e 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: Hodnota RollForward {0} je neplatná. Povolené jsou tyto hodnoty: {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: Projekt byl obnoven pomocí aplikace {0} verze {1}, ale s aktuálním nastavením by se místo toho použít verze {2}. Tento problém vyřešíte tak, že zkontrolujete, že se pro obnovení a následné operace, například sestavení nebo publikování, používá stejné nastavení. Obvykle k tomuto problému může dojít, pokud je vlastnost RuntimeIdentifier nastavena při sestavování nebo publikování, ale ne při obnovování. Další informace najdete na stránce https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: Aktuální sada .NET SDK nepodporuje cílení {0} {1}. Buď zacilte {0} {2} nebo nižší, nebo použijte verzi sady .NET SDK, která podporuje {0} {1}.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.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.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf
index a2d8066e29f6..76d45c6794f7 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: Der RollForward-Wert "{0}" ist ungültig. Zulässige Werte: {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: Das Projekt wurde mit {0}, Version {1} wiederhergestellt, aber mit den aktuellen Einstellungen würde stattdessen Version {2} verwendet werden. Um dieses Problem zu beheben, müssen Sie sicherstellen, dass für die Wiederherstellung und für nachfolgende Vorgänge wie das Kompilieren oder Veröffentlichen dieselben Einstellungen verwendet werden. Dieses Problem tritt typischerweise auf, wenn die RuntimeIdentifier-Eigenschaft bei der Kompilierung oder Veröffentlichung, aber nicht bei der Wiederherstellung festgelegt wird. Weitere Informationen finden Sie unter https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: Das aktuelle .NET SDK unterstützt {0} {1} nicht als Ziel. Geben Sie entweder {0} {2} oder niedriger als Ziel an, oder verwenden Sie eine .NET SDK-Version, die {0} {1} unterstützt.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: Für das Erstellen von Windows-Desktopanwendungen ist Microsoft.NET.Sdk.WindowsDesktop erforderlich. "UseWpf" und "UseWindowsForms" werden vom aktuellen SDK nicht unterstützt.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf
index 969f534516fe..5f446f198a9d 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: El valor "{0}" de RollForward no es válido. Los valores permitidos son: {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: El proyecto fue restaurado utilizando la versión {0} {1}, pero con la configuración actual, la versión {2} se utilizaría en su lugar. Para resolver este problema, asegúrese de que la misma configuración se utiliza para restaurar y para operaciones posteriores como compilar o publicar. Normalmente, este problema puede producirse si la `propiedad RuntimeIdentifier se establece durante la compilación o la publicación pero no durante la restauración. Para obtener más información, consulte https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: El SDK de .NET actual no admite el destino {0} {1}. Use el destino {0} {2} u otro inferior, o bien una versión del SDK de .NET que admita {0} {1}.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: Se requiere Microsoft.NET.Sdk.WindowsDesktop para compilar las aplicaciones de escritorio de Windows. El SDK actual no admite "UseWpf" ni "UseWindowsForms".
diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
index 6975a6b09192..abfe30684aac 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: la valeur RollForward '{0}' est non valide. Les valeurs autorisées sont {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: Le projet a été restauré avec la version {0} {1}, mais avec les paramètres actuels, la version {2} serait utilisée à la place. Pour résoudre ce problème, assurez-vous que les mêmes paramètres sont utilisés pour la restauration et pour les opérations ultérieures telles que la génération et la publication. Généralement, ce problème peut se produire si la propriété RuntimeIdentifier est définie au cours de la génération ou de la publication, mais pas pendant la restauration. Pour plus d’informations, consultez https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: Le kit .NET SDK actuel ne prend pas en charge le ciblage de {0} {1}. Vous devez soit cibler {0} {2} ou une version antérieure, soit utiliser une version du kit .NET SDK qui prend en charge {0} {1}.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.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.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf
index ae82d581d800..403c821ff3da 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: il valore '{0}' di RollForward non è valido. I valori consentiti sono {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: per il ripristino del progetto è stato usato {0} versione {1}, ma con le impostazioni correnti viene usata la versione {2}. Per risolvere il problema, assicurarsi di usare le stesse impostazioni per il ripristino e per le operazioni successive, quali compilazione o pubblicazione. In genere questo problema può verificarsi se la proprietà RuntimeIdentifier viene impostata durante la compilazione o la pubblicazione, ma non durante il ripristino. Per altre informazioni, vedere https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: la versione corrente di .NET SDK non supporta {0} {1} come destinazione. Impostare come destinazione {0} {2} o una versione precedente oppure usare una versione di .NET SDK che supporta {0} {1}.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: per compilare applicazioni desktop di Windows, è necessario Microsoft.NET.Sdk.WindowsDesktop. 'UseWpf' e 'UseWindowsForms' non sono supportati dall'SDK corrente.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
index 470deee49b05..391582ebb82f 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: ロールフォワード値 '{0}' が無効です。許可されている値は {1} です。{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: プロジェクトは {0} バージョン {1} を使用して復元されましたが、現在の設定では、バージョン {2} が代わりに使用されます。この問題を解決するには、復元およびこれ以降の操作 (ビルドや公開など) で同じ設定を使用していることをご確認ください。通常この問題は、ビルドや公開の実行時に RuntimeIdentifier プロパティを設定したが、復元時には設定していない場合に発生することがあります。詳しくは、https://aka.ms/dotnet-runtime-patch-selection を参照してください。
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: 現在の .NET SDK は、ターゲットとする {0} {1} をサポートしていません。{0} {2} 以下をターゲットとするか、{0} {1} をサポートする .NET SDK のバージョンを使用してください。{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: Windows デスクトップ アプリケーションを作成するには、Microsoft.NET.Sdk.WindowsDesktop が必要です。現在の SDK では、'UseWpf' と 'UseWindowsForms' はサポートされていません。
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
index 9dc0752a4413..0987fd3811fc 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: RollForward 값 '{0}'이(가) 잘못되었습니다. 허용되는 값은 {1}입니다.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: {0} 버전 {1}을(를) 사용하여 프로젝트가 복원되었지만, 현재 설정에서는 버전 {2}을(를) 대신 사용합니다. 이 문제를 해결하려면 복원 및 후속 작업(예: 빌드 또는 게시)에 동일한 설정을 사용해야 합니다. 일반적으로 이 문제는 RuntimeIdentifier 속성이 빌드 또는 게시 중에 설정되었지만, 복원 중에는 설정되지 않은 경우에 발생할 수 있습니다. 자세한 내용은 https://aka.ms/dotnet-runtime-patch-selection을 참조하세요.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: 현재 .NET SDK에서는 {0} {1}을(를) 대상으로 하는 것을 지원하지 않습니다. {0} {2} 이하를 대상으로 하거나 {0} {1}을(를) 지원하는 .NET SDK 버전을 사용하세요.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop을 사용하려면 Windows 데스크톱 애플리케이션을 빌드해야 합니다. 'UseWpf' 및 'UseWindowsForms'는 현재 SDK에서 지원하지 않습니다.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
index 67dd5dcf21ae..de91e7c8ce1f 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: Wartość RollForward „{0}” jest nieprawidłowa. Dozwolone wartości to {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: Projekt został przywrócony przy użyciu pakietu {0} w wersji {1}, ale w przypadku bieżących ustawień zamiast niej zostałaby użyta wersja {2}. Aby rozwiązać ten problem, upewnij się, że te same ustawienia są używane do przywracania i dla kolejnych operacji, takich jak kompilacja lub publikowanie. Ten problem zazwyczaj występuje, gdy właściwość RuntimeIdentifier jest ustawiona podczas kompilacji lub publikowania, ale nie podczas przywracania. Aby uzyskać więcej informacji, zobacz https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: Bieżący zestaw .NET SDK nie obsługuje używania środowiska docelowego {0} {1}. Użyj jako środowiska docelowego wersji {0} {2} lub starszej albo użyj wersji zestawu .NET SDK obsługującej środowisko {0} {1}.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.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.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
index 94ca968d02a7..77df417cb9b1 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: o valor de RollForward '{0}' é inválido. Os valores permitidos são {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: o projeto foi restaurado usando o {0} versão {1}, mas, com as configurações atuais, a versão {2} seria usada. Para resolver esse problema, verifique se as mesmas configurações são usadas para restauração e para operações subsequentes, como compilação ou publicação. Normalmente, esse problema poderá ocorrer se a propriedade RuntimeIdentifier for definida durante a compilação ou a publicação, mas não durante a restauração. Para obter mais informações, consulte https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: O SDK do .NET atual não dá suporte para direcionar a {0} {1}. Direcione a {0} {2} ou inferior, ou use uma versão do SDK do .NET compatível com {0} {1}.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.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.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
index 86d0743aebd9..76960df4c2b2 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: недопустимое значение RollForward "{0}". Разрешенные значения — {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: Проект был восстановлен с использованием {0} версии {1}, но с текущими параметрами вместо этой версии будет использована версия {2}. Чтобы устранить эту проблему, убедитесь, что для восстановления и последующих операций (таких как сборка или публикация) используются одинаковые параметры. Обычно эта проблема возникает, когда свойство RuntimeIdentifier устанавливается во время сборки или публикации, но не во время восстановления. Дополнительные сведения см. на странице https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: текущий пакет SDK для .NET не поддерживает целевой объект {0} {1}. Выберите {0} {2} или более раннюю версию либо используйте версию пакета SDK для .NET, которая поддерживает {0} {1}.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: для сборки классических приложений для Windows требуется Microsoft.NET.Sdk.WindowsDesktop. "UseWpf" и "UseWindowsForms" не поддерживаются текущим пакетом SDK.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
index 870ba3662669..2140dca1cd1f 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: '{0}' RollForward değeri geçersiz. İzin verilen değerler {1}.{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: Proje, {0} sürüm {1} kullanılarak geri yüklendi, ancak geçerli ayarlarla, bunun yerine sürüm {2} kullanılması gerekiyordu. Bu sorunu çözmek amacıyla, geri yükleme için ve derleme veya yayımlama gibi sonraki işlemler için aynı ayarların kullanıldığından emin olun. Bu sorun genellikle RuntimeIdentifier özelliği derleme veya yayımlama sırasında ayarlandığında ancak geri yükleme sırasında ayarlanmadığında oluşur. Daha fazla bilgi için bkz. https://aka.ms/dotnet-runtime-patch-selection.
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: Geçerli .NET SDK’sı {0} {1} sürümünü hedeflemeyi desteklemiyor. {0} {2} veya daha düşük bir sürümü hedefleyin veya {0} {1} destekleyen bir .NET SDK’sı kullanın.{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: Windows Masaüstü uygulamalarını derlemek için Microsoft.NET.Sdk.WindowsDesktop gereklidir. 'UseWpf' ve 'UseWindowsForms' geçerli SDK tarafından desteklenmiyor.
diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
index 044093ed2d33..839ee924011a 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: RollForward 值“{0}”无效。允许的值为 {1}。{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: 项目是使用 {0} 版本 {1} 还原的, 但使用当前设置, 将改用版本 {2}。要解决此问题, 请确保将相同的设置用于还原和后续操作 (如生成或发布)。通常, 如果 RuntimeIdentifier 属性是在生成或发布过程中设置的, 而不是在还原过程中进行的, 则会发生此问题。有关详细信息, 请参阅 https://aka.ms/dotnet-runtime-patch-selection。
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: 当前 .NET SDK 不支持将 {0} {1} 设置为目标。请将 {0} {2} 或更低版本设置为目标,或使用支持 {0} {1} 的 .NET SDK 版本。{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: 要构建 Windows 桌面应用程序,需使用 Microsoft.NET.Sdk.WindowsDesktop。当前 SDK 不支持 "UseWpf" 和 "UseWindowsForms"。
diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
index 32657fb96aab..9f3c6af658e3 100644
--- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
+++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
@@ -395,6 +395,13 @@ The following are names of parameters or literal values and should not be transl
NETSDK1104: RollForward 值 '{0}' 無效。允許的值為 {1}。{StrBegin="NETSDK1104: "}
+
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ NETSDK1140: {0} is not a valid TargetPlatformVersion for {1}. Valid versions include:
+{2}
+ {StrBegin="NETSDK1140: "}
+ NETSDK1061: The project was restored using {0} version {1}, but with current settings, version {2} would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.NETSDK1061: 專案是使用 {0} 版本 {1} 還原的,但依照目前設定,使用的版本會是 {2}。若要解決此問題,請確認用於還原與後續作業 (例如建置或發佈) 的設定相同。一般而言,若在建置或發佈期間設定了 RuntimeIdentifier,但在還原期間未加以設定,就可能發生這個問題。如需詳細資訊,請參閱 https://aka.ms/dotnet-runtime-patch-selection。
@@ -653,6 +660,11 @@ The following are names of parameters or literal values and should not be transl
NETSDK1045: 目前的 .NET SDK 不支援以 {0} {1} 作為目標。請以 {0} {2} 或更低版本作為目標,或是使用支援 {0} {1} 的 .NET SDK 版本。{StrBegin="NETSDK1045: "}
+
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ NETSDK1139: The target platform identifier {0} was not recognized.
+ {StrBegin="NETSDK1139: "}
+ NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.NETSDK1107: 需有 Microsoft.NET.Sdk.WindowsDesktop 才能建置 Windows 傳統型應用程式。目前的 SDK 不支援 'UseWpf' 和 'UseWindowsForms'。
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 b9563175512e..d50d7192a596 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
@@ -16,6 +16,7 @@ Copyright (c) .NET Foundation. All rights reserved.
+
+
+
+
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 945907353355..ecb871d48c4a 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
@@ -46,36 +46,28 @@ Copyright (c) .NET Foundation. All rights reserved.
-
-
- <_ShortFrameworkIdentifier>$(TargetFramework.TrimEnd('.0123456789'))
- <_ShortFrameworkVersion>$(TargetFramework.Substring($(_ShortFrameworkIdentifier.Length)))
-
-
-
-
- v$(_ShortFrameworkVersion)
-
+
+
-
-
- v$(_ShortFrameworkVersion[0]).0
- v$(_ShortFrameworkVersion[0]).$(_ShortFrameworkVersion[1])
- v$(_ShortFrameworkVersion[0]).$(_ShortFrameworkVersion[1]).$(_ShortFrameworkVersion[2])
+ $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'))
+ v$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)', 3))
+ <_TargetFrameworkVersionLength Condition="$(TargetFrameworkVersion.EndsWith('.0'))" >$([MSBuild]::Subtract($(TargetFrameworkVersion.Length), 2))
+ $(TargetFrameworkVersion.Substring(0, $(_TargetFrameworkVersionLength)))
-
-
-
- .NETStandard
- .NETCoreApp
-
- .NETFramework
- .NETCoreApp
+
+
+ $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))
+ $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 3))
+
+ <_TargetPlatformVersionLength Condition="$(TargetPlatformVersion.EndsWith('.0'))" >$([MSBuild]::Subtract($(TargetPlatformVersion.Length), 2))
+ $(TargetPlatformVersion.Substring(0, $(_TargetPlatformVersionLength)))
+
+ Windows
-
+
<_UnsupportedTargetFrameworkError>true
@@ -114,6 +106,19 @@ Copyright (c) .NET Foundation. All rights reserved.
FormatArguments="$([MSBuild]::Escape('$(TargetFramework)'))" />
+
+
+
+ true
+
+
+
+
+
@@ -193,6 +198,24 @@ Copyright (c) .NET Foundation. All rights reserved.
FormatArguments="$(MinimumOSPlatform);$(TargetPlatformVersion)"/>
+
+
+
+
+
+
+ true
+ @(SupportedTargetPlatform, '%0a')
+ None
+
+
+
+
+
7.0
+
+ Windows,Version=7.0
+ Windows 7.0
diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props
new file mode 100644
index 000000000000..273924989c4c
--- /dev/null
+++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliNonLibraryProject.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliNonLibraryProject.cs
index 0b6fa90a7106..a77c0b9fd15c 100644
--- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliNonLibraryProject.cs
+++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliNonLibraryProject.cs
@@ -20,7 +20,7 @@ public GivenThatWeWantToBuildACppCliNonLibraryProject(ITestOutputHelper log) : b
{
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void Given_an_exe_project_It_should_fail_with_error_message()
{
var testAsset = _testAssetsManager
@@ -34,7 +34,7 @@ public void Given_an_exe_project_It_should_fail_with_error_message()
.And.HaveStdOutContaining(Strings.NoSupportCppNonDynamicLibraryDotnetCore);
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void Given_an_StaticLibrary_project_It_should_fail_with_error_message()
{
var testAsset = _testAssetsManager
diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliProject.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliProject.cs
index f2741dece790..3bf65f2a8c49 100644
--- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliProject.cs
+++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACppCliProject.cs
@@ -78,7 +78,7 @@ public void Given_Wpf_framework_reference_It_builds_cpp_project()
.Pass();
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void It_fails_with_error_message_on_EnableComHosting()
{
var testAsset = _testAssetsManager
@@ -106,7 +106,7 @@ public void It_fails_with_error_message_on_EnableComHosting()
.HaveStdOutContaining(Strings.NoSupportCppEnableComHosting);
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void It_fails_with_error_message_on_fullframework()
{
var testAsset = _testAssetsManager
@@ -123,7 +123,7 @@ public void It_fails_with_error_message_on_fullframework()
.HaveStdOutContaining(Strings.NETFrameworkWithoutUsingNETSdkDefaults);
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void It_fails_with_error_message_on_tfm_lower_than_3_1()
{
var testAsset = _testAssetsManager
@@ -140,7 +140,7 @@ public void It_fails_with_error_message_on_tfm_lower_than_3_1()
.HaveStdOutContaining(Strings.CppRequiresTFMVersion31);
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void When_run_with_selfcontained_It_fails_with_error_message()
{
var testAsset = _testAssetsManager
diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs
index bfd06d10f5e3..dfb19aaba2d8 100644
--- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs
+++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs
@@ -417,13 +417,13 @@ public void It_implicitly_defines_compilation_constants_for_the_target_framework
itemGroup.Add(supportedFramework);
});
- AssertDefinedConstantsOutput(testAsset, targetFramework, new[] { "NETCOREAPP", "NET" }.Concat(expectedDefines).ToArray());
+ AssertDefinedConstantsOutput(testAsset, targetFramework, new[] { "NETCOREAPP", "NET"}.Concat(expectedDefines).ToArray());
}
[Theory]
[InlineData("ios", "1.1", new[] { "IOS", "IOS1_1" })]
[InlineData("android", "2.2", new[] { "ANDROID", "ANDROID2_2" })]
- [InlineData("windows", "10.1", new[] { "WINDOWS", "WINDOWS10_1" })]
+ [InlineData("windows", "7.0", new[] { "WINDOWS", "WINDOWS7_0" })]
public void It_implicitly_defines_compilation_constants_for_the_target_platform(string targetPlatformIdentifier, string targetPlatformVersion, string[] expectedDefines)
{
var targetFramework = "net5.0";
@@ -442,6 +442,8 @@ public void It_implicitly_defines_compilation_constants_for_the_target_platform(
propGroup.Add(platformIdentifier);
var platformVersion = new XElement(ns + "TargetPlatformVersion", targetPlatformVersion);
propGroup.Add(platformVersion);
+ var platformSupported = new XElement(ns + "TargetPlatformSupported", true);
+ propGroup.Add(platformSupported);
var disableUnnecessaryImplicitFrameworkReferencesForThisTest = new XElement(ns + "DisableImplicitFrameworkReferences", "true");
propGroup.Add(disableUnnecessaryImplicitFrameworkReferencesForThisTest);
});
@@ -452,7 +454,7 @@ public void It_implicitly_defines_compilation_constants_for_the_target_platform(
[Theory]
[InlineData(new[] { "1.0", "1.1" }, "ios", "1.1", new[] { "IOS", "IOS1_1", "IOS1_0" })]
[InlineData(new[] { "11.11", "12.12", "13.13" }, "android", "12.12", new[] { "ANDROID", "ANDROID11_11", "ANDROID12_12" })]
- [InlineData(new[] { "7.0", "8.0", "10.0.19041", "11.0.0" }, "windows", "11.0.0", new[] { "WINDOWS", "WINDOWS7_0", "WINDOWS8_0", "WINDOWS10_0_19041", "WINDOWS11_0_0" })]
+ [InlineData(new string[] { /* Use the built in SupportedTargetPlatform items */}, "windows", "10.0.19041", new[] { "WINDOWS", "WINDOWS7_0", "WINDOWS8_0", "WINDOWS10_0_17763", "WINDOWS10_0_18362", "WINDOWS10_0_19041" })]
public void It_implicitly_defines_compilation_constants_for_the_target_platform_with_backwards_compatibility(string[] supportedTargetPlatform, string targetPlatformIdentifier, string targetPlatformVersion, string[] expectedDefines)
{
var targetFramework = "net5.0";
@@ -471,6 +473,8 @@ public void It_implicitly_defines_compilation_constants_for_the_target_platform_
propGroup.Add(platformIdentifier);
var platformVersion = new XElement(ns + "TargetPlatformVersion", targetPlatformVersion);
propGroup.Add(platformVersion);
+ var platformSupported = new XElement(ns + "TargetPlatformSupported", true);
+ propGroup.Add(platformSupported);
var disableUnnecessaryImplicitFrameworkReferencesForThisTest = new XElement(ns + "DisableImplicitFrameworkReferences", "true");
propGroup.Add(disableUnnecessaryImplicitFrameworkReferencesForThisTest);
@@ -506,7 +510,7 @@ private void AssertDefinedConstantsOutput(TestAsset testAsset, string targetFram
definedConstants.Should().BeEquivalentTo(new[] { "DEBUG", "TRACE" }.Concat(expectedDefines).ToArray());
}
- [WindowsOnlyRequiresMSBuildVersionTheory("16.8.0")]
+ [WindowsOnlyTheory]
[InlineData("netcoreapp3.1", new[] { "NETCOREAPP", "NETCOREAPP3_1" })]
[InlineData("net5.0", new[] { "NETCOREAPP", "NETCOREAPP3_1", "NET", "NET5_0", "WINDOWS", "WINDOWS7_0" }, "windows", "7.0")]
public void It_can_use_implicitly_defined_compilation_constants(string targetFramework, string[] expectedOutput, string targetPlatformIdentifier = null, string targetPlatformVersion = null)
@@ -626,7 +630,6 @@ public void It_defines_target_platform_defaults_correctly(string targetFramework
.Execute()
.Should()
.Pass();
-
var values = getValuesCommand.GetValues();
if (defaultsDefined)
{
@@ -639,7 +642,7 @@ public void It_defines_target_platform_defaults_correctly(string targetFramework
}
}
- [RequiresMSBuildVersionTheory("16.8.0")]
+ [Theory]
[InlineData("net5.0")]
[InlineData("netcoreapp3.1")]
public void It_defines_windows_version_default_correctly(string targetFramework)
@@ -956,7 +959,7 @@ public void It_can_build_with_dynamic_loading_enabled(string targetFramework, st
}
- [RequiresMSBuildVersionTheory("16.8.0")]
+ [Theory]
[InlineData("netcoreapp3.1")]
[InlineData("netcoreapp5.0")]
public void It_makes_RootNamespace_safe_when_project_name_has_spaces(string targetFramework)
diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibraryWithOSMinimumVersion.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibraryWithOSMinimumVersion.cs
index 4787d3170f71..32aa67ba4ee5 100644
--- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibraryWithOSMinimumVersion.cs
+++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibraryWithOSMinimumVersion.cs
@@ -38,6 +38,8 @@ public void WhenPropertiesAreSetItCanGenerateMinimumOSPlatformAttribute()
var targetPlatformIdentifier = "iOS";
testProject.AdditionalProperties["TargetPlatformIdentifier"] = targetPlatformIdentifier;
+ testProject.AdditionalProperties["TargetPlatformSupported"] = "true";
+ testProject.AdditionalProperties["TargetPlatformVersionSupported"] = "true";
testProject.AdditionalProperties["MinimumOSPlatform"] = "13.2";
testProject.AdditionalProperties["TargetPlatformVersion"] = "14.0";
@@ -57,6 +59,8 @@ public void WhenMinimumOSPlatformISNotSetTargetPlatformVersionIsSetItCanGenerate
var targetPlatformIdentifier = "iOS";
testProject.AdditionalProperties["TargetPlatformIdentifier"] = targetPlatformIdentifier;
+ testProject.AdditionalProperties["TargetPlatformSupported"] = "true";
+ testProject.AdditionalProperties["TargetPlatformVersionSupported"] = "true";
testProject.AdditionalProperties["TargetPlatformVersion"] = "13.2";
var testAsset = _testAssetsManager.CreateTestProject(testProject);
@@ -75,8 +79,10 @@ public void WhenMinimumOSPlatformIsHigherThanTargetPlatformVersionItShouldError(
var targetPlatformIdentifier = "iOS";
testProject.AdditionalProperties["TargetPlatformIdentifier"] = targetPlatformIdentifier;
+ testProject.AdditionalProperties["TargetPlatformVersionSupported"] = "true";
testProject.AdditionalProperties["TargetPlatformVersion"] = "13.2";
testProject.AdditionalProperties["MinimumOSPlatform"] = "14.0";
+ testProject.AdditionalProperties["TargetPlatformSupported"] = "true";
var testAsset = _testAssetsManager.CreateTestProject(testProject);
diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs
index 0abc32d46a95..f794e7e29e27 100644
--- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs
+++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs
@@ -30,6 +30,7 @@ public void It_errors_when_missing_windows_target_platform(string propertyName)
};
testProject.AdditionalProperties[propertyName] = "true";
testProject.AdditionalProperties["TargetPlatformIdentifier"] = "custom"; // Make sure we don't get windows implicitly set as the TPI
+ testProject.AdditionalProperties["TargetPlatformSupported"] = "true";
var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: propertyName);
var buildCommand = new BuildCommand(testAsset);
@@ -100,6 +101,46 @@ public void It_warns_when_specifying_windows_desktop_sdk()
.Pass()
.And
.HaveStdOutContaining("NETSDK1137");
+ }
+
+ [WindowsOnlyFact]
+ public void It_fails_if_windows_target_platform_version_is_invalid()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "InvalidWindowsVersion",
+ IsSdkProject = true,
+ TargetFrameworks = "net5.0-windows1.0"
+ };
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+ buildCommand.Execute()
+ .Should()
+ .Fail()
+ .And
+ .HaveStdOutContaining("NETSDK1140");
+ }
+
+ [Fact]
+ public void It_fails_if_target_platform_identifier_and_version_are_invalid()
+ {
+ var testProject = new TestProject()
+ {
+ Name = "InvalidTargetPlatform",
+ IsSdkProject = true,
+ TargetFrameworks = "net5.0-custom1.0"
+ };
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var buildCommand = new BuildCommand(testAsset);
+ buildCommand.Execute()
+ .Should()
+ .Fail()
+ .And
+ .HaveStdOutContaining("NETSDK1139")
+ .And
+ .NotHaveStdOutContaining("NETSDK1140");
}
}
}
diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildWithATargetPlatform.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildWithATargetPlatform.cs
new file mode 100644
index 000000000000..8a69daf7ed6b
--- /dev/null
+++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildWithATargetPlatform.cs
@@ -0,0 +1,84 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.NET.TestFramework;
+using Microsoft.NET.TestFramework.Assertions;
+using Microsoft.NET.TestFramework.Commands;
+using Xunit;
+using FluentAssertions;
+using Xunit.Abstractions;
+using Microsoft.NET.TestFramework.ProjectConstruction;
+using System.IO;
+using System;
+
+namespace Microsoft.NET.Build.Tests
+{
+ public class GivenThatWeWantToBuildWithATargetPlatform : SdkTest
+ {
+ public GivenThatWeWantToBuildWithATargetPlatform(ITestOutputHelper log) : base(log)
+ {
+ }
+
+ [WindowsOnlyTheory]
+ [InlineData("netcoreapp3.1", ".NETCoreApp", "v3.1", "Windows", "7.0")] // Default values pre-5.0
+ [InlineData("net5.0", ".NETCoreApp", "v5.0", "", "")]
+ [InlineData("net5.0-Windows7.0", ".NETCoreApp", "v5.0", "Windows", "7.0")]
+ [InlineData("net5.0-WINDOWS7.0", ".NETCoreApp", "v5.0", "Windows", "7.0")]
+ [InlineData("net5.0-windows", ".NETCoreApp", "v5.0", "Windows", "7.0")]
+ [InlineData("net5.0-windows10.0.19041", ".NETCoreApp", "v5.0", "Windows", "10.0.19041")]
+ public void It_defines_target_platform_from_target_framework(string targetFramework, string expectedTargetFrameworkIdentifier, string expectedTargetFrameworkVersion, string expectedTargetPlatformIdentifier, string expectedTargetPlatformVersion)
+ {
+ var testProj = new TestProject()
+ {
+ Name = "TargetPlatformTests",
+ IsSdkProject = true,
+ TargetFrameworks = targetFramework
+ };
+ var testAsset = _testAssetsManager.CreateTestProject(testProj);
+
+ Action assertValue = (string valueName, string expected) =>
+ {
+ var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.Path, testProj.Name), targetFramework, valueName);
+ getValuesCommand
+ .Execute()
+ .Should()
+ .Pass();
+ if (expected.Trim().Equals(string.Empty))
+ {
+ getValuesCommand.GetValues().Count.Should().Be(0);
+ }
+ else
+ {
+ getValuesCommand.GetValues().ShouldBeEquivalentTo(new[] { expected });
+ }
+ };
+
+ assertValue("TargetFrameworkIdentifier", expectedTargetFrameworkIdentifier);
+ assertValue("TargetFrameworkVersion", expectedTargetFrameworkVersion);
+ assertValue("TargetPlatformIdentifier", expectedTargetPlatformIdentifier);
+ assertValue("TargetPlatformIdentifier", expectedTargetPlatformIdentifier);
+ assertValue("TargetPlatformVersion", expectedTargetPlatformVersion);
+ assertValue("TargetPlatformMoniker", $"{expectedTargetPlatformIdentifier},Version={expectedTargetPlatformVersion}");
+ assertValue("TargetPlatformDisplayName", $"{expectedTargetPlatformIdentifier} {expectedTargetPlatformVersion}");
+ }
+
+ [Fact]
+ public void It_fails_on_unsupported_os()
+ {
+ TestProject testProject = new TestProject()
+ {
+ Name = "UnsupportedOS",
+ IsSdkProject = true,
+ TargetFrameworks = "net5.0-unsupported"
+ };
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ var build = new BuildCommand(Log, Path.Combine(testAsset.Path, testProject.Name));
+ build.Execute()
+ .Should()
+ .Fail()
+ .And
+ .HaveStdOutContaining("NETSDK1139");
+ }
+ }
+}
diff --git a/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackACppCliProject.cs b/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackACppCliProject.cs
index fc00b8fed015..e2b51d416a60 100644
--- a/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackACppCliProject.cs
+++ b/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackACppCliProject.cs
@@ -18,7 +18,7 @@ public GivenThatWeWantToPackACppCliProject(ITestOutputHelper log) : base(log)
{
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void It_cannot_pack_the_cppcliproject()
{
var testAsset = _testAssetsManager
diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishACppCliAppProject.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishACppCliAppProject.cs
index b07f2c31d214..848c8400622f 100644
--- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishACppCliAppProject.cs
+++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishACppCliAppProject.cs
@@ -18,7 +18,7 @@ public GivenThatWeWantToPublishACppCliAppProject(ITestOutputHelper log) : base(l
{
}
- [FullMSBuildOnlyFact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void It_should_fail_with_error_message()
{
var testAsset = _testAssetsManager
diff --git a/src/Tests/dotnet-list-package.Tests/GivenDotnetListPackage.cs b/src/Tests/dotnet-list-package.Tests/GivenDotnetListPackage.cs
index 86d4330ef626..426cceaeec33 100644
--- a/src/Tests/dotnet-list-package.Tests/GivenDotnetListPackage.cs
+++ b/src/Tests/dotnet-list-package.Tests/GivenDotnetListPackage.cs
@@ -225,7 +225,7 @@ public void ItDoesNotAcceptInvalidFramework()
.Fail();
}
- [Fact]
+ [FullMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/12560")]
public void ItListsFSharpProject()
{
var testAssetName = "FSharpTestAppSimple";
diff --git a/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs b/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
index 0a31f78bd561..8e96103c3c87 100644
--- a/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
+++ b/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
@@ -572,5 +572,56 @@ public void ItForwardsEmptyArgumentsToTheApp()
.And
.HaveStdOutContaining($"0 = a{Environment.NewLine}1 = {Environment.NewLine}2 = c");
}
+
+ [Fact]
+ public void ItDoesNotPrintBuildingMessageByDefault()
+ {
+ var expectedValue = "Building...";
+ var testAppName = "TestAppSimple";
+ var testInstance = _testAssetsManager.CopyTestAsset(testAppName)
+ .WithSource();
+
+ new DotnetCommand(Log, "run")
+ .WithWorkingDirectory(testInstance.Path)
+ .Execute()
+ .Should()
+ .Pass()
+ .And
+ .NotHaveStdOutContaining(expectedValue);
+ }
+
+ [Fact]
+ public void ItPrintsBuildingMessageIfLaunchSettingHasDotnetRunMessagesSet()
+ {
+ var expectedValue = "Building...";
+ var testAppName = "TestAppWithLaunchSettings";
+ var testInstance = _testAssetsManager.CopyTestAsset(testAppName)
+ .WithSource();
+
+ new DotnetCommand(Log, "run")
+ .WithWorkingDirectory(testInstance.Path)
+ .Execute()
+ .Should()
+ .Pass()
+ .And
+ .HaveStdOutContaining(expectedValue);
+ }
+
+ [Fact]
+ public void ItIncludesEnvironmentVariablesSpecifiedInLaunchSettings()
+ {
+ var expectedValue = "MyCoolEnvironmentVariableKey=MyCoolEnvironmentVariableValue";
+ var testAppName = "TestAppWithLaunchSettings";
+ var testInstance = _testAssetsManager.CopyTestAsset(testAppName)
+ .WithSource();
+
+ new DotnetCommand(Log, "run")
+ .WithWorkingDirectory(testInstance.Path)
+ .Execute()
+ .Should()
+ .Pass()
+ .And
+ .HaveStdOutContaining(expectedValue);
+ }
}
}
diff --git a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs
index b7b4259b788f..dfd05c865b7f 100644
--- a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs
+++ b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs
@@ -28,7 +28,7 @@ public GivenDotnettestBuildsAndRunsTestfromCsproj(ITestOutputHelper log) : base(
{
}
- private readonly string [] ConsoleLoggerOutputNormal = new[] { "--logger", "console;verbosity=normal" };
+ private readonly string[] ConsoleLoggerOutputNormal = new[] { "--logger", "console;verbosity=normal" };
[Fact]
public void MSTestSingleTFM()
@@ -261,7 +261,7 @@ public void TestWillCreateTrxLoggerInTheSpecifiedResultsDirectoryBySwitch()
result.StdOut.Should().Contain(trxFiles[0]);
// Cleanup trxLoggerDirectory if it exist
- if(Directory.Exists(trxLoggerDirectory))
+ if (Directory.Exists(trxLoggerDirectory))
{
Directory.Delete(trxLoggerDirectory, true);
}
@@ -307,7 +307,7 @@ public void ItBuildsAndTestsAppWhenRestoringToSpecificDirectory()
.WithVersionVariables()
.Path;
-
+
string pkgDir;
//if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
//{
@@ -443,7 +443,7 @@ public void ItCreatesCoverageFileWhenCodeCoverageEnabledByRunsettings()
Directory.Delete(resultsDirectory, true);
}
- var settingsPath =Path.Combine(AppContext.BaseDirectory, "CollectCodeCoverage.runsettings");
+ var settingsPath = Path.Combine(AppContext.BaseDirectory, "CollectCodeCoverage.runsettings");
// Call test
CommandResult result = new DotnetTestCommand(Log)