From 5534074a3223015430b5ccaf66041f7dc0f6f7a1 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 27 Sep 2023 23:27:59 +0000 Subject: [PATCH 1/5] Detect multitargeted apps for trim/AOT warning --- .../ProcessFrameworkReferences.cs | 10 ++- .../Microsoft.NET.EolTargetFrameworks.targets | 3 + .../targets/Microsoft.NET.Publish.targets | 53 +++++++++++++++- ...T.Sdk.FrameworkReferenceResolution.targets | 2 + .../GivenThatWeWantToPublishAnAotApp.cs | 25 ++++++++ .../GivenThatWeWantToRunILLink.cs | 62 +++++++++++++------ 6 files changed, 133 insertions(+), 22 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index cc05b837c1f5..d191cbc7a336 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -45,12 +45,16 @@ public class ProcessFrameworkReferences : TaskBase public bool IsAotCompatible { get; set; } + public bool SilenceIsAotCompatibleUnsupportedWarning { get; set; } + public bool EnableAotAnalyzer { get; set; } public bool PublishTrimmed { get; set; } public bool IsTrimmable { get; set; } + public bool SilenceIsTrimmableUnsupportedWarning { get; set; } + public bool EnableTrimAnalyzer { get; set; } public bool EnableSingleFileAnalyzer { get; set; } @@ -442,7 +446,8 @@ protected override void ExecuteCore() } else if (IsAotCompatible || EnableAotAnalyzer) { - Log.LogWarning(Strings.IsAotCompatibleUnsupported); + if (!SilenceIsAotCompatibleUnsupportedWarning) + Log.LogWarning(Strings.IsAotCompatibleUnsupported); } else if (PublishTrimmed) { @@ -450,7 +455,8 @@ protected override void ExecuteCore() } else if (IsTrimmable || EnableTrimAnalyzer) { - Log.LogWarning(Strings.IsTrimmableUnsupported); + if (!SilenceIsTrimmableUnsupportedWarning) + Log.LogWarning(Strings.IsTrimmableUnsupported); } else if (EnableSingleFileAnalyzer) { diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets index b0468946626c..d9bd74aa368f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets @@ -23,6 +23,9 @@ Copyright (c) .NET Foundation. All rights reserved. <_EolNetCoreTargetFrameworkVersions Include="1.0;1.1;2.0;2.1;2.2;3.0;3.1;5.0" /> + + <_MinimumNonEolSupportedNetCoreTargetFramework>net6.0 + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets index c8bb2d7504e2..06ed19f927ee 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets @@ -30,7 +30,7 @@ Copyright (c) .NET Foundation. All rights reserved. - + @@ -42,6 +42,57 @@ Copyright (c) .NET Foundation. All rights reserved. '$(EnableSingleFileAnalyzer)' == 'true')">true <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == ''">false + + + + + + <_FirstTargetFrameworkToSupportTrimming>net6.0 + <_FirstTargetFrameworkToSupportAot>net7.0 + + <_MinNonEolTargetFrameworkForTrimming>$(_MinimumNonEolSupportedNetCoreTargetFramework) + + <_MinNonEolTargetFrameworkForAot>$(_MinimumNonEolSupportedNetCoreTargetFramework) + <_MinNonEolTargetFrameworkForAot Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(_FirstTargetFrameworkToSupportAot)', '$(_MinimumNonEolSupportedNetCoreTargetFramework)'))">$(_FirstTargetFrameworkToSupportAot) + + + + <_TargetFramework Include="$(TargetFrameworks)" /> + <_DecomposedTargetFramework Include="@(_TargetFramework)"> + $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportTrimming)')) + $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForTrimming)', '%(Identity)')) + $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportAot)')) + $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForAot)', '%(Identity)')) + + + <_TargetFrameworksToSilenceIsTrimmableUnsupportedWarning + Include="@(_DecomposedTargetFramework)" + Condition="'%(SupportsTrimming)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForTrimming)' == 'true'" /> + <_TargetFrameworksToSilenceIsAotCompatibleUnsupportedWarning + Include="@(_DecomposedTargetFramework->'%(Identity)')" + Condition="'%(SupportsAot)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForAot)' == 'true'" /> + + + + + <_SilenceIsTrimmableUnsupportedWarning Condition="'$(_SilenceIsTrimmableUnsupportedWarning)' == '' And + @(_TargetFrameworksToSilenceIsTrimmableUnsupportedWarning->Count()) > 0">true + <_SilenceIsAotCompatibleUnsupportedWarning Condition="'$(_SilenceIsAotCompatibleUnsupportedWarning)' == '' And + @(_TargetFrameworksToSilenceIsAotCompatibleUnsupportedWarning->Count()) > 0">true + + @@ -61,9 +62,11 @@ Copyright (c) .NET Foundation. All rights reserved. <_FirstTargetFrameworkToSupportTrimming>net6.0 <_FirstTargetFrameworkToSupportAot>net7.0 - + <_FirstTargetFrameworkToSupportSingleFile>net6.0 + <_MinNonEolTargetFrameworkForTrimming>$(_MinimumNonEolSupportedNetCoreTargetFramework) - + <_MinNonEolTargetFrameworkForSingleFile>$(_MinimumNonEolSupportedNetCoreTargetFramework) + <_MinNonEolTargetFrameworkForAot>$(_MinimumNonEolSupportedNetCoreTargetFramework) <_MinNonEolTargetFrameworkForAot Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(_FirstTargetFrameworkToSupportAot)', '$(_MinimumNonEolSupportedNetCoreTargetFramework)'))">$(_FirstTargetFrameworkToSupportAot) @@ -75,22 +78,29 @@ Copyright (c) .NET Foundation. All rights reserved. $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForTrimming)', '%(Identity)')) $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportAot)')) $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForAot)', '%(Identity)')) + $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportSingleFile)')) + $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForSingleFile)', '%(Identity)')) - <_TargetFrameworksToSilenceIsTrimmableUnsupportedWarning + <_TargetFrameworkToSilenceIsTrimmableUnsupportedWarning Include="@(_DecomposedTargetFramework)" Condition="'%(SupportsTrimming)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForTrimming)' == 'true'" /> - <_TargetFrameworksToSilenceIsAotCompatibleUnsupportedWarning + <_TargetFrameworkToSilenceIsAotCompatibleUnsupportedWarning Include="@(_DecomposedTargetFramework->'%(Identity)')" Condition="'%(SupportsAot)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForAot)' == 'true'" /> + <_TargetFrameworkToSilenceEnableSingleFileAnalyzerUnsupportedWarning + Include="@(_DecomposedTargetFramework)" + Condition="'%(SupportsSingleFile)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForSingleFile)' == 'true'" /> <_SilenceIsTrimmableUnsupportedWarning Condition="'$(_SilenceIsTrimmableUnsupportedWarning)' == '' And - @(_TargetFrameworksToSilenceIsTrimmableUnsupportedWarning->Count()) > 0">true + @(_TargetFrameworkToSilenceIsTrimmableUnsupportedWarning->Count()) > 0">true <_SilenceIsAotCompatibleUnsupportedWarning Condition="'$(_SilenceIsAotCompatibleUnsupportedWarning)' == '' And - @(_TargetFrameworksToSilenceIsAotCompatibleUnsupportedWarning->Count()) > 0">true + @(_TargetFrameworkToSilenceIsAotCompatibleUnsupportedWarning->Count()) > 0">true + <_SilenceEnableSingleFileAnalyzerUnsupportedWarning Condition="'$(_SilenceEnableSingleFileAnalyzerUnsupportedWarning)' == '' And + @(_TargetFrameworkToSilenceEnableSingleFileAnalyzerUnsupportedWarning->Count()) > 0">true diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets index ded3c7362c67..b8317662f3c0 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets @@ -109,6 +109,7 @@ Copyright (c) .NET Foundation. All rights reserved. SilenceIsTrimmableUnsupportedWarning="$(_SilenceIsTrimmableUnsupportedWarning)" EnableTrimAnalyzer="$(EnableTrimAnalyzer)" EnableSingleFileAnalyzer="$(EnableSingleFileAnalyzer)" + SilenceEnableSingleFileAnalyzerUnsupportedWarning="$(_SilenceEnableSingleFileAnalyzerUnsupportedWarning)" AotUseKnownRuntimePackForTarget="$(PublishAotUsingRuntimePack)" RuntimeIdentifier="$(RuntimeIdentifier)" RuntimeIdentifiers="$(RuntimeIdentifiers)" diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 2ce93f8c64d6..f6df722efee1 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -653,6 +653,31 @@ public void EnableSingleFileAnalyzer_warns_for_unsupported_target_framework(stri .And.HaveStdOutContaining($"warning NETSDK1211"); } + [RequiresMSBuildVersionTheory("17.0.0.32901")] + [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for single-file + [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for single-file and targeting. + [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for single-file, but leaves a "gap" for the supported net6./net7.0 TFMs. + public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted_libraries(string targetFrameworks, bool shouldWarn) + { + + var testProject = new TestProject() + { + Name = "ClassLibTest", + TargetFrameworks = targetFrameworks + }; + testProject.AdditionalProperties["EnableSingleFileAnalyzer"] = "true"; + var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks); + + var buildCommand = new BuildCommand(testAsset); + var resultAssertion = buildCommand.Execute() + .Should().Pass(); + if (shouldWarn) { + resultAssertion.And.HaveStdOutContaining($"warning NETSDK1211"); + } else { + resultAssertion.And.NotHaveStdOutContaining($"warning"); + } + } + private TestProject CreateTestProjectWithAnalyzerWarnings(string targetFramework, string projectName, bool isExecutable) { var testProject = new TestProject() From cf8418957ccc4d896144da9c7a5b017562ebc7fe Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 28 Sep 2023 16:59:51 +0000 Subject: [PATCH 3/5] Pass TFMs into warning format strings, unify tests --- src/Tasks/Common/Resources/Strings.resx | 6 ++-- src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.de.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.es.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.it.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 18 ++++++------ .../Common/Resources/xlf/Strings.pt-BR.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 18 ++++++------ src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 18 ++++++------ .../Common/Resources/xlf/Strings.zh-Hans.xlf | 18 ++++++------ .../Common/Resources/xlf/Strings.zh-Hant.xlf | 18 ++++++------ .../ProcessFrameworkReferences.cs | 12 ++++++-- ...T.Sdk.FrameworkReferenceResolution.targets | 3 ++ .../GivenThatWeWantToPublishASingleFileApp.cs | 28 ++++--------------- .../GivenThatWeWantToPublishAnAotApp.cs | 28 ++++--------------- .../GivenThatWeWantToRunILLink.cs | 26 +++++------------ 19 files changed, 151 insertions(+), 186 deletions(-) diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx index 14be6011411e..dfce481b86bd 100644 --- a/src/Tasks/Common/Resources/Strings.resx +++ b/src/Tasks/Common/Resources/Strings.resx @@ -931,17 +931,17 @@ You may need to build the project on another operating system or architecture, o NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index 6e94ce5fe565..08687c1ea5c2 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer se pro cílovou architekturu nepodporuje. Zvažte vícenásobné cílení na podporovanou architekturu, abyste mohli povolit analýzu jednoho souboru, a nastavte EnableSingleFileAnalyzer pouze pro podporované architektury. Příklad: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible se pro cílovou architekturu nepodporuje. Zvažte vícenásobné cílení na podporovanou architekturu, abyste umožnili analýzu kompilace předem, a nastavte IsAotCompatible pouze pro podporované architektury. Příklad: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable se pro cílovou architekturu nepodporuje. Zvažte vícenásobné cílení na podporovanou architekturu, která umožňuje oříznutí, a nastavte IsTrimmable pouze pro podporované architektury. Příklad: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index e35cc82a016b..dfda4f53d776 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer wird für das Zielframework nicht unterstützt. Erwägen Sie die Festlegung mehrerer Zielversionen auf ein unterstütztes Framework, um die Einzeldateianalyse zu aktivieren, und legen Sie EnableSingleFileAnalyzer nur für die unterstützten Frameworks fest. Beispiel: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible wird für das Zielframework nicht unterstützt. Erwägen Sie die Festlegung mehrerer Zielversionen auf ein unterstütztes Framework, um eine Vorabkompilierungsanalyse zu ermöglichen, und legen Sie IsAotCompatible nur für die unterstützten Frameworks fest. Beispiel: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable wird für das Zielframework nicht unterstützt. Erwägen Sie die Festlegung mehrerer Zielversionen auf ein unterstütztes Framework, um das Kürzen zu aktivieren, und legen Sie IsTrimmable nur für die unterstützten Frameworks fest. Beispiel: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index adfa6174c139..cbf2cb64563f 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer no se admite para la plataforma de destino. Considere la posibilidad de usar varios destinos en un marco compatible para habilitar el análisis de archivos únicos y establezca EnableSingleFileAnalyzer solo para los marcos admitidos. Por ejemplo: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible no se admite para la plataforma de destino. Considere la posibilidad de usar varios destinos en un marco compatible para habilitar el análisis de compilación con antelación y establezca IsAotCompatible solo para los marcos admitidos. Por ejemplo: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable no se admite para la plataforma de destino. Considere la posibilidad de usar varios destinos en un marco compatible para habilitar el recorte y establezca IsTrimmable solo para los marcos admitidos. Por ejemplo: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index 2c506c4198c6..619f190da2d9 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer n'est pas pris en charge pour le framework cible. Envisagez le multi-ciblage vers un framework pris en charge pour activer l'analyse de fichier unique, et définissez EnableSingleFileAnalyzer uniquement pour les frameworks pris en charge. Par exemple : -<EnableSingleFileAnalyzer Condition="$([MSBuild] ::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible n'est pas pris en charge pour le framework cible. Envisagez le multi-ciblage vers un framework pris en charge pour permettre une analyse de compilation en amont, et définissez IsAotCompatible uniquement pour les frameworks pris en charge. Par exemple : -<IsAotCompatible Condition="$([MSBuild] ::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable n'est pas pris en charge pour le framework cible. Envisagez le multi-ciblage vers un framework pris en charge pour activer le découpage, et définissez IsTrimmable uniquement pour les frameworks pris en charge. Par exemple : -<IsTrimmable Condition="$([MSBuild] ::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index 3b455033050b..7247f33057e9 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer non è supportato per il framework di destinazione. Provare a usare più destinazioni in un framework supportato per abilitare l'analisi a file singolo e impostare EnableSingleFileAnalyzer solo per i framework supportati. Per esempio: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible non è supportato per il framework di destinazione. Provare a usare più destinazioni in un framework supportato per abilitare l'analisi di compilazione in anticipo e impostare IsAotCompatible solo per i framework supportati. Ad esempio: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable non è supportato per il framework di destinazione. Provare a usare più destinazioni in un framework supportato per abilitare la limitazione e impostare IsTrimmable solo per i framework supportati. Per esempio: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index 0fcde8015c82..6889931032c8 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer はターゲット フレームワークではサポートされていません。単一ファイル分析を有効にするには、サポートされているフレームワークに対するマルチターゲットを検討し、サポートされているフレームワークに限り EnableSingleFileAnalyzer を設定してください。例: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible はターゲット フレームワークではサポートされていません。Ahead of Time コンパイル分析を有効にするには、サポートされているフレームワークに対するマルチターゲットを検討し、サポートされているフレームワークに限り IsAotCompatible を設定してください。例: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable はターゲット フレームワークではサポートされていません。トリミングを有効にするには、サポートされているフレームワークに対するマルチターゲットを検討し、サポートされているフレームワークに限り IsTrimmable を設定してください。例: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index 13f3ccaa0338..0130054b34c0 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: 대상 프레임워크에는 EnableSingleFileAnalyzer가 지원되지 않습니다. 지원되는 프레임워크에 다중 대상을 지정하여 단일 파일 분석을 사용하도록 설정하고 지원되는 프레임워크에 대해서만 EnableSingleFileAnalyzer를 설정하세요. 예: -true <EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))"></EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible은 대상 프레임워크에 대해 지원되지 않습니다. 지원되는 프레임워크에 다중 대상을 지정하여 AOT(Ahead-of-time) 컴파일 분석을 사용하도록 설정하고 지원되는 프레임워크에 대해서만 IsAotCompatible을 설정하세요. 예: -true <IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))"></IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable은 대상 프레임워크에 대해 지원되지 않습니다. 지원되는 프레임워크에 다중 대상을 지정하여 트리밍을 사용하도록 설정하고 지원되는 프레임워크에 대해서만 IsTrimmable을 설정하세요. 예: -true <IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))"></IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index d86985db03ae..cad5a7e20a0a 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer nie jest obsługiwany dla platformy docelowej. Rozważ zastosowanie wielu elementów docelowych do obsługiwanej platformy, aby umożliwić analizę pojedynczych plików, i ustaw parametr EnableSingleFileAnalyzer tylko dla obsługiwanych platform. Na przykład: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: Element IsAotCompatible nie jest obsługiwany dla platformy docelowej. Rozważ zastosowanie wielu elementów docelowych do obsługiwanej platformy, aby umożliwić analizę kompilacji z wyprzedzeniem, i ustaw wartość IsAotCompatible tylko dla obsługiwanych platform. Na przykład: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: Element IsTrimmable nie jest obsługiwany dla platformy docelowej. Rozważ zastosowanie wielu elementów docelowych do obsługiwanej platformy, aby włączyć przycinanie, i ustaw właściwość IsTrimmable tylko dla obsługiwanych platform. Na przykład: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index b765ba7f71b9..9225d5333768 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer não é compatível com a estrutura de destino. Considere o direcionamento múltiplo para uma estrutura com suporte para habilitar a análise de arquivo único e defina EnableSingleFileAnalyzer somente para as estruturas com suporte. Por exemplo: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">verdadeiro</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible não é compatível com a estrutura de destino. Considere o direcionamento múltiplo para uma estrutura com suporte para permitir a análise de compilação antecipada e defina IsAotCompatible apenas para as estruturas com suporte. Por exemplo: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">verdadeiro</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable não é compatível com a estrutura de destino. Considere o direcionamento múltiplo para uma estrutura com suporte para habilitar o corte e defina IsTrimmable somente para as estruturas com suporte. Por exemplo: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">verdadeiro</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index 5919db70072d..8df90e4b276a 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer не поддерживается целевой платформой. Рассмотрите возможность использовать несколько целевых версий для поддерживаемой платформы, чтобы включить анализ одного файла, и настройте EnableSingleFileAnalyzer только для поддерживаемых платформ. Например: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible не поддерживается целевой платформой. Рассмотрите возможность использовать несколько целевых версий для поддерживаемой платформы, чтобы включить анализ AOT-компиляции, и настройте IsAotCompatible только для поддерживаемых платформ. Например: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable не поддерживается целевой платформой. Рассмотрите возможность использовать несколько целевых версий для поддерживаемой платформы, чтобы включить обрезку, и настройте IsTrimmable только для поддерживаемых платформ. Например: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index 95ec1167a175..060c8d48faf2 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: EnableSingleFileAnalyzer hedef altyapı için desteklenmiyor. Tek dosya analizini etkinleştirmek için desteklenen bir altyapıya çoklu hedeflemeyi kullanabilirsiniz ve desteklenen altyapılar için EnableSingleFileAnalyzer komutunu ayarlayabilirsiniz. Örneğin: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: IsAotCompatible hedef altyapı için desteklenmiyor. Önceden derleme analizini etkinleştirmek için desteklenen bir altyapıya çoklu hedefleme uygulayabilirsiniz ve IsAotCompatible'ı yalnızca desteklenen altyapılar için ayarlayabilirsiniz. Örneğin: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: IsTrimmable hedef altyapı için desteklenmiyor. Kırpmayı etkinleştirmek için desteklenen bir altyapıya çoklu hedefleme uygulayabilirsiniz ve IsTrimmable'ı yalnızca desteklenen altyapılar için ayarlayabilirisiniz. Örneğin: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index d089936cf64b..76a366bc2a19 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: 目标框架不支持 EnableSingleFileAnalyzer。请考虑对受支持的框架进行多目标设定来启用单文件分析,并且仅为受支持的框架设置 EnableSingleFileAnalyzer。例如: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: 目标框架不支持 IsAotCompatible。请考虑对受支持的框架进行多目标设定来启用提前编译分析,并且仅为受支持的框架设置 IsAotCompatible。例如: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: 目标框架不支持 IsTrimmable。请考虑对受支持的框架进行多目标设定以启用剪裁,并且仅为受支持的框架设置 IsTrimmable。例如: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index 923a82066cbb..c116cd92275e 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -401,9 +401,9 @@ NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> - NETSDK1211: 目標架構不支援 EnableSingleFileAnalyzer。考慮對支援的架構設定多重目標,以啟用單一檔案分析,並僅針對支援的架構設定 EnableSingleFileAnalyzer。例如: -<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</EnableSingleFileAnalyzer> +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example: +<EnableSingleFileAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</EnableSingleFileAnalyzer> {StrBegin="NETSDK1211: "} @@ -571,16 +571,16 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> - NETSDK1210: 目標架構不支援 IsAotCompatible。考慮對支援的架構設定多重目標,以啟用提前編譯分析,並僅針對支援的架構設定 IsAotCompatible。例如: -<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example: +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> - NETSDK1212: 目標架構不支援 IsTrimmable。考慮對支援的架構設定多重目標,以啟用修剪,並僅針對支援的架構設定 IsTrimmable。例如: -<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable> +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> + NETSDK1212: IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example: +<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '{0}'))">true</IsTrimmable> {StrBegin="NETSDK1212: "} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index 31a480e11b7d..47927f3d189e 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -47,6 +47,8 @@ public class ProcessFrameworkReferences : TaskBase public bool SilenceIsAotCompatibleUnsupportedWarning { get; set; } + public string MinNonEolTargetFrameworkForAot { get; set; } + public bool EnableAotAnalyzer { get; set; } public bool PublishTrimmed { get; set; } @@ -55,12 +57,16 @@ public class ProcessFrameworkReferences : TaskBase public bool SilenceIsTrimmableUnsupportedWarning { get; set; } + public string MinNonEolTargetFrameworkForTrimming { get; set; } + public bool EnableTrimAnalyzer { get; set; } public bool EnableSingleFileAnalyzer { get; set; } public bool SilenceEnableSingleFileAnalyzerUnsupportedWarning { get; set; } + public string MinNonEolTargetFrameworkForSingleFile { get; set; } + public bool AotUseKnownRuntimePackForTarget { get; set; } public string RuntimeIdentifier { get; set; } @@ -449,7 +455,7 @@ protected override void ExecuteCore() else if (IsAotCompatible || EnableAotAnalyzer) { if (!SilenceIsAotCompatibleUnsupportedWarning) - Log.LogWarning(Strings.IsAotCompatibleUnsupported); + Log.LogWarning(Strings.IsAotCompatibleUnsupported, MinNonEolTargetFrameworkForAot); } else if (PublishTrimmed) { @@ -458,14 +464,14 @@ protected override void ExecuteCore() else if (IsTrimmable || EnableTrimAnalyzer) { if (!SilenceIsTrimmableUnsupportedWarning) - Log.LogWarning(Strings.IsTrimmableUnsupported); + Log.LogWarning(Strings.IsTrimmableUnsupported, MinNonEolTargetFrameworkForTrimming); } else if (EnableSingleFileAnalyzer) { // There's no IsSingleFileCompatible setting. EnableSingleFileAnalyzer is the // recommended way to ensure single-file compatibility for libraries. if (!SilenceEnableSingleFileAnalyzerUnsupportedWarning) - Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported); + Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported, MinNonEolTargetFrameworkForSingleFile); } else { diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets index b8317662f3c0..0cf0b6cc48c4 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets @@ -103,13 +103,16 @@ Copyright (c) .NET Foundation. All rights reserved. RequiresILLinkPack="$(_RequiresILLinkPack)" IsAotCompatible="$(IsAotCompatible)" SilenceIsAotCompatibleUnsupportedWarning="$(_SilenceIsAotCompatibleUnsupportedWarning)" + MinNonEolTargetFrameworkForAot="$(_MinNonEolTargetFrameworkForAot)" EnableAotAnalyzer="$(EnableAotAnalyzer)" PublishTrimmed="$(PublishTrimmed)" IsTrimmable="$(IsTrimmable)" SilenceIsTrimmableUnsupportedWarning="$(_SilenceIsTrimmableUnsupportedWarning)" + MinNonEolTargetFrameworkForTrimming="$(_MinNonEolTargetFrameworkForTrimming)" EnableTrimAnalyzer="$(EnableTrimAnalyzer)" EnableSingleFileAnalyzer="$(EnableSingleFileAnalyzer)" SilenceEnableSingleFileAnalyzerUnsupportedWarning="$(_SilenceEnableSingleFileAnalyzerUnsupportedWarning)" + MinNonEolTargetFrameworkForSingleFile="$(_MinNonEolTargetFrameworkForSingleFile)" AotUseKnownRuntimePackForTarget="$(PublishAotUsingRuntimePack)" RuntimeIdentifier="$(RuntimeIdentifier)" RuntimeIdentifiers="$(RuntimeIdentifiers)" diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index f6df722efee1..282d8dc9800a 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -633,27 +633,7 @@ public void ILLink_analyzer_warnings_are_produced_using_EnableSingleFileAnalyzer } [RequiresMSBuildVersionTheory("17.0.0.32901")] - [InlineData("netstandard2.0")] - public void EnableSingleFileAnalyzer_warns_for_unsupported_target_framework(string targetFramework) - { - var testProject = new TestProject() - { - Name = "ClassLibTest", - TargetFrameworks = targetFramework - }; - testProject.AdditionalProperties["EnableSingleFileAnalyzer"] = "true"; - var testAsset = _testAssetsManager.CreateTestProject(testProject); - - var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); - buildCommand - .Execute() - .Should().Pass() - // Note: can't check for Strings.EnableSingleFileAnalyzerUnsupported because each line of - // the message gets prefixed with a file path by MSBuild. - .And.HaveStdOutContaining($"warning NETSDK1211"); - } - - [RequiresMSBuildVersionTheory("17.0.0.32901")] + [InlineData("netstandard2.0", true)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for single-file [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for single-file and targeting. [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for single-file, but leaves a "gap" for the supported net6./net7.0 TFMs. @@ -672,7 +652,11 @@ public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted var resultAssertion = buildCommand.Execute() .Should().Pass(); if (shouldWarn) { - resultAssertion.And.HaveStdOutContaining($"warning NETSDK1211"); + // Note: can't check for Strings.EnableSingleFileAnalyzerUnsupported because each line of + // the message gets prefixed with a file path by MSBuild. + resultAssertion + .And.HaveStdOutContaining($"warning NETSDK1211") + .And.HaveStdOutContaining($"true"); } else { resultAssertion.And.NotHaveStdOutContaining($"warning"); } diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index 525f4fbc9ba1..446b2188dada 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -591,27 +591,7 @@ public void IsAotCompatible_implies_enable_analyzers(string targetFramework) } [RequiresMSBuildVersionTheory("17.0.0.32901")] - [InlineData("netstandard2.0")] - public void IsAotCompatible_warns_for_unsupported_target_framework(string targetFramework) - { - var testProject = new TestProject() - { - Name = "ClassLibTest", - TargetFrameworks = targetFramework - }; - testProject.AdditionalProperties["IsAotCompatible"] = "true"; - var testAsset = _testAssetsManager.CreateTestProject(testProject); - - var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); - buildCommand - .Execute() - .Should().Pass() - // Note: can't check for Strings.IsAotCompatibleUnsupported because each line of - // the message gets prefixed with a file path by MSBuild. - .And.HaveStdOutContaining("warning NETSDK1210"); - } - - [RequiresMSBuildVersionTheory("17.0.0.32901")] + [InlineData("netstandard2.0", true)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for AOT [InlineData("netstandard2.0;net7.0", false)] // Net7.0 is the min TFM supported for AOT and targeting. [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for AOT, but leaves a "gap" for the supported net7.0 TFMs. @@ -630,7 +610,11 @@ public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_li var resultAssertion = buildCommand.Execute() .Should().Pass(); if (shouldWarn) { - resultAssertion.And.HaveStdOutContaining($"warning NETSDK1210"); + resultAssertion + // Note: can't check for Strings.IsAotCompatibleUnsupported because each line of + // the message gets prefixed with a file path by MSBuild. + .And.HaveStdOutContaining($"warning NETSDK1210") + .And.HaveStdOutContaining($"true"); } else { resultAssertion.And.NotHaveStdOutContaining($"warning"); } diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 151287e606cf..417098bc615c 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -165,24 +165,8 @@ public void PublishTrimmed_fails_for_unsupported_target_framework(string targetF } [RequiresMSBuildVersionTheory("17.0.0.32901")] - [InlineData("netstandard2.0")] - [InlineData("netstandard2.1")] - public void IsTrimmable_warns_for_unsupported_target_framework(string targetFramework) - { - var projectName = "HelloWorld"; - var rid = EnvironmentInfo.GetCompatibleRid(targetFramework); - - var testProject = CreateTestProjectForILLinkTesting(targetFramework, projectName); - var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFramework); - var buildCommand = new BuildCommand(testAsset); - buildCommand.Execute("/p:IsTrimmable=true") - .Should().Pass() - // Note: can't check for Strings.IsTrimmableUnsupported because each line of - // the message gets prefixed with a file path by MSBuild. - .And.HaveStdOutContaining($"warning NETSDK1212"); - } - - [RequiresMSBuildVersionTheory("17.0.0.32901")] + [InlineData("netstandard2.0", true)] + [InlineData("netstandard2.1", true)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for trimming [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for trimming and targeting. [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for trimming, but leaves a "gap" for the supported net6.0/net7.0 TFMs. @@ -198,7 +182,11 @@ public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libr var resultAssertion = buildCommand.Execute() .Should().Pass(); if (shouldWarn) { - resultAssertion.And.HaveStdOutContaining($"warning NETSDK1212"); + resultAssertion + // Note: can't check for Strings.IsTrimmableUnsupported because each line of + // the message gets prefixed with a file path by MSBuild. + .And.HaveStdOutContaining($"warning NETSDK1212") + .And.HaveStdOutContaining($"true"); } else { resultAssertion.And.NotHaveStdOutContaining($"warning"); } From 40c322363d3c6cfe2f933b511300a4388284dae0 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 28 Sep 2023 22:24:39 +0000 Subject: [PATCH 4/5] Add testcases for TFM alias behavior --- .../GivenThatWeWantToPublishASingleFileApp.cs | 11 +++++++--- .../GivenThatWeWantToPublishAnAotApp.cs | 8 ++++++- .../GivenThatWeWantToRunILLink.cs | 8 ++++++- .../PublishTestUtils.cs | 21 +++++++++++++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 282d8dc9800a..6739242bb7b5 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -5,6 +5,7 @@ using Microsoft.DotNet.Cli.Utils; using Microsoft.NET.Build.Tasks; using NuGet.Frameworks; +using static Microsoft.NET.Publish.Tests.PublishTestUtils; namespace Microsoft.NET.Publish.Tests { @@ -637,19 +638,23 @@ public void ILLink_analyzer_warnings_are_produced_using_EnableSingleFileAnalyzer [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for single-file [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for single-file and targeting. [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for single-file, but leaves a "gap" for the supported net6./net7.0 TFMs. + [InlineData("alias-ns2", true)] + [InlineData("alias-n6", false)] + [InlineData("alias-n6;alias-n8", false)] // If all TFMs are supported, there's no warning even though the project uses aliases. + [InlineData("alias-ns2;alias-n6", true)] // This is correctly multi-targeted, but the logic can't detect this due to the alias so it still warns. public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted_libraries(string targetFrameworks, bool shouldWarn) { - var testProject = new TestProject() { Name = "ClassLibTest", TargetFrameworks = targetFrameworks }; testProject.AdditionalProperties["EnableSingleFileAnalyzer"] = "true"; - var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks); + var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) + .WithProjectChanges(AddTargetFrameworkAliases); var buildCommand = new BuildCommand(testAsset); - var resultAssertion = buildCommand.Execute() + var resultAssertion = buildCommand.Execute("/bl:my.binlog") .Should().Pass(); if (shouldWarn) { // Note: can't check for Strings.EnableSingleFileAnalyzerUnsupported because each line of diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index 446b2188dada..130792471fa0 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -595,6 +595,10 @@ public void IsAotCompatible_implies_enable_analyzers(string targetFramework) [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for AOT [InlineData("netstandard2.0;net7.0", false)] // Net7.0 is the min TFM supported for AOT and targeting. [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for AOT, but leaves a "gap" for the supported net7.0 TFMs. + [InlineData("alias-ns2", true)] + [InlineData("alias-n6", false)] + [InlineData("alias-n7;alias-n8", false)] // If all TFMs are supported, there's no warning even though the project uses aliases. + [InlineData("alias-ns2;alias-n7", true)] // This is correctly multi-targeted, but the logic can't detect this due to the alias so it still warns. public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_libraries(string targetFrameworks, bool shouldWarn) { var rid = EnvironmentInfo.GetCompatibleRid(targetFrameworks); @@ -605,7 +609,9 @@ public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_li TargetFrameworks = targetFrameworks }; testProject.AdditionalProperties["IsAotCompatible"] = "true"; - var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks); + var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) + .WithProjectChanges(AddTargetFrameworkAliases); + var buildCommand = new BuildCommand(testAsset); var resultAssertion = buildCommand.Execute() .Should().Pass(); diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 417098bc615c..a25a1e7a0d1a 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -170,6 +170,10 @@ public void PublishTrimmed_fails_for_unsupported_target_framework(string targetF [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for trimming [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for trimming and targeting. [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for trimming, but leaves a "gap" for the supported net6.0/net7.0 TFMs. + [InlineData("alias-ns2", true)] + [InlineData("alias-n6", false)] + [InlineData("alias-n6;alias-n8", false)] // If all TFMs are supported, there's no warning even though the project uses aliases. + [InlineData("alias-ns2;alias-n6", true)] // This is correctly multi-targeted, but the logic can't detect this due to the alias so it still warns. public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libraries(string targetFrameworks, bool shouldWarn) { var projectName = "HelloWorld"; @@ -177,7 +181,9 @@ public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libr var testProject = CreateTestProjectForILLinkTesting(targetFrameworks, projectName); testProject.AdditionalProperties["IsTrimmable"] = "true"; - var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks); + var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) + .WithProjectChanges(AddTargetFrameworkAliases); + var buildCommand = new BuildCommand(testAsset); var resultAssertion = buildCommand.Execute() .Should().Pass(); diff --git a/src/Tests/Microsoft.NET.Publish.Tests/PublishTestUtils.cs b/src/Tests/Microsoft.NET.Publish.Tests/PublishTestUtils.cs index 9ae403c3daee..579115c3341f 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/PublishTestUtils.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/PublishTestUtils.cs @@ -42,5 +42,26 @@ internal static class PublishTestUtils #else #error If building for a newer TFM, please update the values above to include both the old and new TFMs. #endif + + public static void AddTargetFrameworkAliases(XDocument project) + { + var ns = project.Root.Name.Namespace; + project.Root.Add(new XElement(ns + "PropertyGroup", + new XAttribute("Condition", "'$(TargetFramework)' == 'alias-ns2'"), + new XElement(ns + "TargetFrameworkIdentifier", ".NETStandard"), + new XElement(ns + "TargetFrameworkVersion", "v2.0"))); + project.Root.Add(new XElement(ns + "PropertyGroup", + new XAttribute("Condition", "'$(TargetFramework)' == 'alias-n6'"), + new XElement(ns + "TargetFrameworkIdentifier", ".NETCoreApp"), + new XElement(ns + "TargetFrameworkVersion", "v6.0"))); + project.Root.Add(new XElement(ns + "PropertyGroup", + new XAttribute("Condition", "'$(TargetFramework)' == 'alias-n7'"), + new XElement(ns + "TargetFrameworkIdentifier", ".NETCoreApp"), + new XElement(ns + "TargetFrameworkVersion", "v7.0"))); + project.Root.Add(new XElement(ns + "PropertyGroup", + new XAttribute("Condition", "'$(TargetFramework)' == 'alias-n8'"), + new XElement(ns + "TargetFrameworkIdentifier", ".NETCoreApp"), + new XElement(ns + "TargetFrameworkVersion", "v8.0"))); + } } } From e19b8edffaa70668dab1283bdcb7ba838bdd4212 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 29 Sep 2023 15:21:31 +0000 Subject: [PATCH 5/5] Require VS 17.8.0 to target .NET 8 --- .../GivenThatWeWantToPublishASingleFileApp.cs | 2 +- .../GivenThatWeWantToPublishAnAotApp.cs | 2 +- .../Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 6739242bb7b5..f1300ba8eed8 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -633,7 +633,7 @@ public void ILLink_analyzer_warnings_are_produced_using_EnableSingleFileAnalyzer .And.HaveStdOutContaining("(10,13): warning IL3001"); } - [RequiresMSBuildVersionTheory("17.0.0.32901")] + [RequiresMSBuildVersionTheory("17.8.0")] [InlineData("netstandard2.0", true)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for single-file [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for single-file and targeting. diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index 130792471fa0..a77b160a6820 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -590,7 +590,7 @@ public void IsAotCompatible_implies_enable_analyzers(string targetFramework) .And.NotHaveStdOutContaining("warning IL3002"); } - [RequiresMSBuildVersionTheory("17.0.0.32901")] + [RequiresMSBuildVersionTheory("17.8.0")] [InlineData("netstandard2.0", true)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for AOT [InlineData("netstandard2.0;net7.0", false)] // Net7.0 is the min TFM supported for AOT and targeting. diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index a25a1e7a0d1a..8b8fe79888e8 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -164,7 +164,7 @@ public void PublishTrimmed_fails_for_unsupported_target_framework(string targetF .And.HaveStdOutContaining($"error {Strings.PublishTrimmedRequiresVersion30}"); } - [RequiresMSBuildVersionTheory("17.0.0.32901")] + [RequiresMSBuildVersionTheory("17.8.0")] [InlineData("netstandard2.0", true)] [InlineData("netstandard2.1", true)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for trimming