From 68e147bb3a61d17f0a4ee518b711b61df1958f2d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 6 Jun 2023 23:00:02 +0000 Subject: [PATCH 01/21] ProcessFrameworkReferences if tool packs are required --- .../ProcessFrameworkReferences.cs | 59 ++++++++++++------- ...T.Sdk.FrameworkReferenceResolution.targets | 6 +- .../GivenThatWeWantToRunILLink.cs | 26 ++++++++ 3 files changed, 69 insertions(+), 22 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index 02d50f672f2f..57030c250b83 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -123,17 +123,14 @@ public class ProcessFrameworkReferences : TaskBase private Version _normalizedTargetFrameworkVersion; - protected override void ExecuteCore() + void AddPacksForFrameworkReferences( + List packagesToDownload, + List runtimeFrameworks, + List targetingPacks, + List runtimePacks, + List unavailableRuntimePacks + ) { - // Perf optimization: If there are no FrameworkReference items, then don't do anything - // (This means that if you don't have any direct framework references, you won't get any transitive ones either - if (FrameworkReferences == null || FrameworkReferences.Length == 0) - { - return; - } - - _normalizedTargetFrameworkVersion = NormalizeVersion(new Version(TargetFrameworkVersion)); - var knownFrameworkReferencesForTargetFramework = KnownFrameworkReferences .Select(item => new KnownFrameworkReference(item)) @@ -156,12 +153,6 @@ protected override void ExecuteCore() var frameworkReferenceMap = FrameworkReferences.ToDictionary(fr => fr.ItemSpec, StringComparer.OrdinalIgnoreCase); - List packagesToDownload = new List(); - List runtimeFrameworks = new List(); - List targetingPacks = new List(); - List runtimePacks = new List(); - List unavailableRuntimePacks = new List(); - HashSet unrecognizedRuntimeIdentifiers = new HashSet(StringComparer.OrdinalIgnoreCase); bool windowsOnlyErrorLogged = false; @@ -363,6 +354,32 @@ var runtimeRequiredByDeployment runtimeFrameworks.Add(runtimeFramework); } } + } + + protected override void ExecuteCore() + { + List packagesToDownload = null; + List runtimeFrameworks = null; + List targetingPacks = null; + List runtimePacks = null; + List unavailableRuntimePacks = null; + + // Perf optimization: If there are no FrameworkReference items, then don't do anything + // (This means that if you don't have any direct framework references, you won't get any transitive ones either + if (FrameworkReferences != null && FrameworkReferences.Length != 0) + { + _normalizedTargetFrameworkVersion = NormalizeVersion(new Version(TargetFrameworkVersion)); + + packagesToDownload = new List(); + runtimeFrameworks = new List(); + targetingPacks = new List(); + runtimePacks = new List(); + unavailableRuntimePacks = new List(); + AddPacksForFrameworkReferences(packagesToDownload, runtimeFrameworks, targetingPacks, runtimePacks, unavailableRuntimePacks); + } + + _normalizedTargetFrameworkVersion ??= NormalizeVersion(new Version(TargetFrameworkVersion)); + packagesToDownload ??= new List(); List implicitPackageReferences = new List(); @@ -413,22 +430,22 @@ var runtimeRequiredByDeployment PackagesToDownload = packagesToDownload.Distinct(new PackageToDownloadComparer()).ToArray(); } - if (runtimeFrameworks.Any()) + if (runtimeFrameworks?.Any() == true) { RuntimeFrameworks = runtimeFrameworks.ToArray(); } - if (targetingPacks.Any()) + if (targetingPacks?.Any() == true) { TargetingPacks = targetingPacks.ToArray(); } - if (runtimePacks.Any()) + if (runtimePacks?.Any() == true) { RuntimePacks = runtimePacks.ToArray(); } - if (unavailableRuntimePacks.Any()) + if (unavailableRuntimePacks?.Any() == true) { UnavailableRuntimePacks = unavailableRuntimePacks.ToArray(); } 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 d4a5897a1744..45e3b557da7f 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 @@ -60,7 +60,11 @@ Copyright (c) .NET Foundation. All rights reserved. + Condition="'@(FrameworkReference)' != '' Or + '$(_RequiresILLinkPack)' == 'true' Or + '$(PublishReadyToRun)' == 'true' Or + '$(PublishAot)' == 'true' Or + '$(UsingMicrosoftNETSdkWebAssembly)' == 'true'"> Date: Wed, 7 Jun 2023 16:41:10 +0000 Subject: [PATCH 02/21] Fix test failures - Don't publish single-file test for unsupported net472 TFM - Expect single-file to fail adding ILLink pack reference for unupported TFMs - Adjust TFM to check single-file error behavior when publishing library --- .../GivenThatWeWantToPublishAHelloWorldProject.cs | 2 +- .../GivenThatWeWantToPublishASingleFileApp.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs index db04eb8aeacd..48dc86f99ea4 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs @@ -1104,7 +1104,7 @@ public void It_publishes_with_implicit_rid_with_rid_specific_properties(string e var testProject = new TestProject() { Name = "PublishImplicitRid", - TargetFrameworks = $"net472;{ToolsetInfo.CurrentTargetFramework}", + TargetFrameworks = ToolsetInfo.CurrentTargetFramework }; testProject.AdditionalProperties.Add("IsPublishable", "false"); var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: executeOptionsAndProperties); diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 932f191c433c..f5f6b8f17e89 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -152,7 +152,7 @@ public void It_errors_when_publishing_single_file_lib() var testProject = new TestProject() { Name = "ClassLib", - TargetFrameworks = "netstandard2.0", + TargetFrameworks = "netcoreapp3.0", IsExe = false, }; @@ -187,7 +187,9 @@ public void It_errors_when_targetting_netstandard() .Should() .Fail() .And - .HaveStdOutContaining(Strings.CanOnlyHaveSingleFileWithNetCoreApp) + // Single-file depends on ILLink analyzers, so fails early when trying + // to add the analyzer reference for an unsupported TFM. + .HaveStdOutContaining(Strings.ILLinkNoValidRuntimePackageError) .And .NotHaveStdOutContaining(Strings.CannotHaveSingleFileWithoutExecutable); } @@ -210,7 +212,9 @@ public void It_errors_when_targetting_netcoreapp_2_x() .Should() .Fail() .And - .HaveStdOutContaining(Strings.PublishSingleFileRequiresVersion30); + // Single-file depends on ILLink analyzers, so fails early when trying + // to add the analyzer reference for an unsupported TFM. + .HaveStdOutContaining(Strings.ILLinkNoValidRuntimePackageError); } [RequiresMSBuildVersionFact("16.8.0")] From c296167d72187dd356ea5f96a386e08f58dec002 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 7 Jun 2023 18:55:49 +0000 Subject: [PATCH 03/21] Fix another test --- .../Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index c6ba1b23f527..89a697fb506a 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -1787,7 +1787,9 @@ public void It_warns_when_targeting_netcoreapp_2_x_illink() .Should() .Pass() .And - .HaveStdOutContaining(Strings.PublishTrimmedRequiresVersion30); + // Fails early when trying to add the illink pack reference for + // an unsupported TFM. + .HaveStdOutContaining(Strings.ILLinkNoValidRuntimePackageError); } private void SetMetadata(XDocument project, string assemblyName, string key, string value) From 81cc9af76ad4637c55b8786e11becf6e3c0ca495 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 7 Jun 2023 18:58:41 +0000 Subject: [PATCH 04/21] Fix another test --- .../GivenThatWeWantToRunILLink.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 89a697fb506a..684c5d80814f 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -1785,10 +1785,10 @@ public void It_warns_when_targeting_netcoreapp_2_x_illink() publishCommand.Execute($"/p:PublishTrimmed=true") .Should() - .Pass() + .Fail() .And - // Fails early when trying to add the illink pack reference for - // an unsupported TFM. + // Fails early when trying to add the illink pack for an + // unsupported TFM. .HaveStdOutContaining(Strings.ILLinkNoValidRuntimePackageError); } From 0739482fcb3d3dfc3bc2cca840bf6a4bc59c2358 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 13 Jul 2023 13:41:58 +0000 Subject: [PATCH 05/21] Fix build --- .../ProcessFrameworkReferences.cs | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index b695652f6b0f..db6794618092 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -132,7 +132,8 @@ void AddPacksForFrameworkReferences( List runtimeFrameworks, List targetingPacks, List runtimePacks, - List unavailableRuntimePacks + List unavailableRuntimePacks, + out List knownRuntimePacksForTargetFramework ) { var knownFrameworkReferencesForTargetFramework = @@ -144,7 +145,7 @@ List unavailableRuntimePacks // Get known runtime packs from known framework references. // Only use items where the framework reference name matches the RuntimeFrameworkName. // This will filter out known framework references for "profiles", ie WindowsForms and WPF - var knownRuntimePacksForTargetFramework = + knownRuntimePacksForTargetFramework = knownFrameworkReferencesForTargetFramework .Where(kfr => kfr.Name.Equals(kfr.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase)) .Select(kfr => kfr.ToKnownRuntimePack()) @@ -367,6 +368,7 @@ protected override void ExecuteCore() List targetingPacks = null; List runtimePacks = null; List unavailableRuntimePacks = null; + List knownRuntimePacksForTargetFramework = null; // Perf optimization: If there are no FrameworkReference items, then don't do anything // (This means that if you don't have any direct framework references, you won't get any transitive ones either @@ -379,7 +381,13 @@ protected override void ExecuteCore() targetingPacks = new List(); runtimePacks = new List(); unavailableRuntimePacks = new List(); - AddPacksForFrameworkReferences(packagesToDownload, runtimeFrameworks, targetingPacks, runtimePacks, unavailableRuntimePacks); + AddPacksForFrameworkReferences( + packagesToDownload, + runtimeFrameworks, + targetingPacks, + runtimePacks, + unavailableRuntimePacks, + out knownRuntimePacksForTargetFramework); } _normalizedTargetFrameworkVersion ??= NormalizeVersion(new Version(TargetFrameworkVersion)); @@ -459,22 +467,25 @@ protected override void ExecuteCore() ImplicitPackageReferences = implicitPackageReferences.ToArray(); } - // Determine the known runtime identifier platforms based on all available Microsoft.NETCore.App packs - HashSet knownRuntimeIdentifierPlatforms = new HashSet(StringComparer.OrdinalIgnoreCase); - var netCoreAppPacks = knownRuntimePacksForTargetFramework.Where(krp => krp.Name.Equals("Microsoft.NETCore.App", StringComparison.OrdinalIgnoreCase)); - foreach (KnownRuntimePack netCoreAppPack in netCoreAppPacks) + if (knownRuntimePacksForTargetFramework?.Any() == true) { - foreach (var runtimeIdentifier in netCoreAppPack.RuntimePackRuntimeIdentifiers.Split(';')) + // Determine the known runtime identifier platforms based on all available Microsoft.NETCore.App packs + HashSet knownRuntimeIdentifierPlatforms = new HashSet(StringComparer.OrdinalIgnoreCase); + var netCoreAppPacks = knownRuntimePacksForTargetFramework!.Where(krp => krp.Name.Equals("Microsoft.NETCore.App", StringComparison.OrdinalIgnoreCase)); + foreach (KnownRuntimePack netCoreAppPack in netCoreAppPacks) { - int separator = runtimeIdentifier.LastIndexOf('-'); - string platform = separator < 0 ? runtimeIdentifier : runtimeIdentifier.Substring(0, separator); - knownRuntimeIdentifierPlatforms.Add(platform); + foreach (var runtimeIdentifier in netCoreAppPack.RuntimePackRuntimeIdentifiers.Split(';')) + { + int separator = runtimeIdentifier.LastIndexOf('-'); + string platform = separator < 0 ? runtimeIdentifier : runtimeIdentifier.Substring(0, separator); + knownRuntimeIdentifierPlatforms.Add(platform); + } } - } - if (knownRuntimeIdentifierPlatforms.Count > 0) - { - KnownRuntimeIdentifierPlatforms = knownRuntimeIdentifierPlatforms.ToArray(); + if (knownRuntimeIdentifierPlatforms.Count > 0) + { + KnownRuntimeIdentifierPlatforms = knownRuntimeIdentifierPlatforms.ToArray(); + } } } From 1a136dff689f32771f316f3a192818a56c32beed Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 13 Jul 2023 13:58:07 +0000 Subject: [PATCH 06/21] Limit scope of change to illink pack --- ...Microsoft.NET.Sdk.FrameworkReferenceResolution.targets | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 dd987035f783..345bf8a69a9c 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 @@ -1,4 +1,4 @@ - + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + + diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index 69f479ff4732..025e20721e68 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -399,6 +399,11 @@ NETSDK1169: Pro dvě knihovny typů, {0} a {1} se zadalo stejné ID prostředku {2}. Duplicitní identifikátory knihovny typů nejsou povoleny. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Mezi {0} a {1} došlo ke konfliktu. @@ -479,15 +484,6 @@ NETSDK1144: Optimalizace velikosti sestavení neproběhla úspěšně. Optimalizaci je možné zakázat tím, že se nastaví vlastnost PublishTrimmed na false. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: Pro vybranou konfiguraci publikování se optimalizace velikosti sestavení nepodporuje. Ujistěte se, že publikujete samostatnou aplikaci. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: Zadané ID knihovny typů {0} pro knihovnu typů {1} je neplatné. ID musí být kladné celé číslo menší než 65536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: Knihovna JIT {0} se nenašla. diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index 9023dd30befc..0cf2af1634f1 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -399,6 +399,11 @@ NETSDK1169: Für zwei Typbibliotheken ("{1}" und "{2}") wurde dieselbe Ressourcen-ID {0} angegeben. Doppelte IDs für Typbibliotheken sind nicht zulässig. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Zwischen "{0}" und "{1}" wurde ein Konflikt festgestellt. @@ -479,15 +484,6 @@ NETSDK1144: Fehler bei der Größenoptimierung von Assemblys. Die Optimierung kann durch Festlegen der PublishTrimmed-Eigenschaft auf FALSE deaktiviert werden. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: Die Größenoptimierung von Assemblys wird für die ausgewählte Veröffentlichungskonfiguration nicht unterstützt. Stellen Sie sicher, dass Sie eine eigenständige App veröffentlichen. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: Die angegebene Typenbibliotheks-ID „{0}“ für die Typbibliothek „{1}“ ist ungültig. Die ID muss eine positive Ganzzahl kleiner als 65536 sein. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: Die JIT-Bibliothek "{0}" wurde nicht gefunden. diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index 615a30504e8d..599016e71f5c 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -399,6 +399,11 @@ NETSDK1169: El mismo Id. de recurso {0} se especificó para dos bibliotecas de tipos "{1}" y "{2}". No se permiten los Id. de la biblioteca de tipos duplicados. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Se encontró un conflicto entre "{0}" y "{1}". @@ -479,15 +484,6 @@ NETSDK1144: Error al optimizar el tamaño de los ensamblados. Para deshabilitar la optimización, establezca la propiedad PublishTrimmed en false. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: No se admite la optimización de tamaño de los ensamblados para la configuración de publicación seleccionada. Asegúrese de que está publicando una aplicación autónoma. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: El identificador de biblioteca de tipos proporcionado "{0}" para la biblioteca de tipos "{1}" no es válido. El identificador debe ser un entero positivo menor de 65 536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: No se encontró la biblioteca JIT "{0}". diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index f3bfe37ffa7d..45e8aa34cc1e 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -399,6 +399,11 @@ NETSDK1169: le même ID de ressource {0} a été spécifié pour deux bibliothèques de types «{1}» et «{2}». Les ID de bibliothèque de types en double ne sont pas autorisés. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Conflit détecté entre '{0}' et '{1}'. @@ -479,15 +484,6 @@ NETSDK1144: L'optimisation de la taille des assemblys a échoué. Vous pouvez désactiver l'optimisation en affectant à la propriété PublishTrimmed la valeur false. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: l'optimisation de la taille des assemblys n'est pas prise en charge pour la configuration de publication sélectionnée. Vérifiez que vous publiez une application autonome. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: L'ID de bibliothèque de types fourni "{0}" pour la bibliothèque de types "{1}" n'est pas valide. L'ID doit être un entier positif inférieur à 65536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: la bibliothèque JIT '{0}' est introuvable. diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index eee24a791581..844830035d25 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -399,6 +399,11 @@ NETSDK1169: The same resource ID {0} was specified for two type libraries '{1}' and '{2}'. Duplicate type library IDs are not allowed. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Encountered conflict between '{0}' and '{1}'. @@ -479,15 +484,6 @@ NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: The provided type library ID '{0}' for type library '{1}' is invalid. The ID must be a positive integer less than 65536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: JIT library '{0}' not found. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index fdfad4db8fb9..ef45af6ff85f 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -399,6 +399,11 @@ NETSDK1169: The same resource ID {0} was specified for two type libraries '{1}' and '{2}'. Duplicate type library IDs are not allowed. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Encountered conflict between '{0}' and '{1}'. @@ -479,15 +484,6 @@ NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: The provided type library ID '{0}' for type library '{1}' is invalid. The ID must be a positive integer less than 65536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: JIT library '{0}' not found. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index 0d51015e8505..269cdaad2e0e 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -399,6 +399,11 @@ NETSDK1169: 두 형식 라이브러리 '{1}' 및 '{2}'에 대해 동일한 리소스 ID {0}가 지정되었습니다. 중복 형식 라이브러리 ID는 허용되지 않습니다. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. '{0}'과(와) '{1}' 사이에 충돌이 발생했습니다. @@ -479,15 +484,6 @@ NETSDK1144: 어셈블리의 크기를 최적화하지 못했습니다. PublishTrimmed 속성을 false로 설정하여 최적화를 사용하지 않도록 설정할 수 있습니다. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: 선택한 게시 구성에서는 크기에 대한 어셈블리 최적화가 지원되지 않습니다. 자체 포함 앱을 게시하고 있는지 확인하세요. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: '{1}' 형식 라이브러리에 대해 제공된 형식 라이브러리 ID '{0}'이(가) 잘못되었습니다. ID는 65536보다 작은 양의 정수여야 합니다. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: JIT 라이브러리 '{0}'을(를) 찾을 수 없습니다. diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index e154aab4c409..e6348fda6a9f 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -399,6 +399,11 @@ NETSDK1169: ten sam identyfikator zasobu {0} został określony dla dwóch bibliotek typów "{1}" i "{2}". Duplikowanie identyfikatorów bibliotek typów jest niedozwolone. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Napotkano konflikt między elementem „{0}” i „{1}”. @@ -479,15 +484,6 @@ NETSDK1144: Optymalizacja zestawów pod kątem rozmiaru nie powiodła się. Optymalizacja może zostać wyłączona przez ustawienie właściwości PublishTrimmed na wartość false. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: Optymalizacja zestawów pod kątem rozmiaru nie jest obsługiwana w przypadku wybranej konfiguracji publikowania. Upewnij się, że publikujesz niezależną aplikację. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: podany identyfikator biblioteki typów „{0}” dla biblioteki typów „{1}” jest nieprawidłowy. Identyfikator musi być dodatnią liczbą całkowitą mniejszą niż 65536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: nie znaleziono biblioteki JIT "{0}". diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index 9a2521b67ef9..8684418327a4 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -399,6 +399,11 @@ NETSDK1169: o mesmo ID de recurso {0} foi especificado para duas bibliotecas de tipo '{1}' e '{2}'. IDs de biblioteca de tipo duplicado não são permitidos. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Encontrado um conflito entre '{0}' e '{1}'. @@ -479,15 +484,6 @@ NETSDK1144: Falha na otimização de assemblies de tamanho. A otimização pode ser desabilitada definindo a propriedade PublishTrimmed como false. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: não há suporte para a otimização de assemblies para tamanho na configuração de publicação selecionada. Verifique se você está publicando um aplicativo independente. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: A ID da biblioteca de tipos fornecida '{0}' para a biblioteca de tipos '{1}' é inválida. O ID deve ser um número inteiro positivo menor que 65536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: biblioteca JIT '{0}' não encontrada. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index 4f0b358da67e..fc65dd7ae714 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -399,6 +399,11 @@ NETSDK1169: один и тот же идентификатор ресурса {0} указан для двух библиотек типов: "{1}" и "{2}". Повторяющиеся идентификаторы библиотек типов не допускаются. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. Обнаружен конфликт между "{0}" и "{1}". @@ -479,15 +484,6 @@ NETSDK1144: не удалось оптимизировать сборки под размер. Оптимизацию можно отключить, установив значение false для свойства PublishTrimmed. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: оптимизация сборок по размеру не поддерживается для выбранной конфигурации публикации. Убедитесь, что вы публикуете автономное приложение. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: указанный идентификатор "{0}" библиотеки типов для библиотеки типов "{1}" недопустим. Идентификатор должен быть положительным целым числом меньше 65536. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: библиотека JIT "{0}" не найдена. diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index 2cabfb572d58..e855996b0e56 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -399,6 +399,11 @@ NETSDK1169: '{1}' ve '{2}' tür kitaplıkları için {0} şeklinde aynı kaynak kimliği belirtildi. Yinelenen tür kitaplığı kimliklerine izin verilmez. {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. '{0}' ile '{1}' arasında çakışmayla karşılaşıldı. @@ -479,15 +484,6 @@ NETSDK1144: Bütünleştirilmiş kodlar boyut için iyileştirilemedi. İyileştirme, PublishTrimmed özelliği false olarak ayarlanarak devre dışı bırakılabilir. {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: Derlemeleri boyut için iyileştirme, seçilen yayımlama yapılandırması için desteklenmiyor. Lütfen kendi içinde bulunan bir uygulama yayımladığınızdan emin olun. @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: '{1}' tür kitaplığı için '{0} ' sağlanan tür kitaplığı kimliği geçersiz. Kimlik 65536’dan küçük bir pozitif tamsayı olmalıdır. {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: JIT kitaplığı '{0}' bulunamadı. diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index 986f19fac192..ef6f2030aff2 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -399,6 +399,11 @@ NETSDK1169: 为两个类型库“{1}”和“{2}”指定了相同的资源 ID {0}。不允许使用重复的类型库 ID。 {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. “{0}”和“{1}”之间存在冲突。 @@ -479,15 +484,6 @@ NETSDK1144: 优化程序集的大小失败。通过将 PublishTrimmed 属性设置为 false 可禁用优化。 {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: 所选发布配置不支持优化程序集的大小。请确保你发布的是独立应用。 @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: 为类型库“{1}”提供的类型库 ID“{0}”无效。该 ID 必须是小于 65536 的正整数。 {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: 找不到 JIT 库“{0}”。 diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index 2c602db3f574..d4fbdc680a3d 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -399,6 +399,11 @@ NETSDK1169: 已為兩個型別程式庫 '{1}' 和 '{2}' 指定了相同的資源識別碼 {0}。不允許重複的型別程式庫識別碼。 {StrBegin="NETSDK1169: "} + + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + {StrBegin="NETSDK1211: "} + Encountered conflict between '{0}' and '{1}'. '{0}' 與 '{1}' 之間發生衝突。 @@ -479,15 +484,6 @@ NETSDK1144: 將元件大小最佳化失敗。將 PublishTrimmed 屬性設定為 false,可停用最佳化。 {StrBegin="NETSDK1144: "} - - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - NETSDK1195: IsTrimmable is 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> -For more information, see https://aka.ms/netsdk1195 - {StrBegin="NETSDK1195: "} - NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. NETSDK1102: 選取的發佈設定不支援最佳化組件的大小。請確定您發佈的是獨立式應用程式。 @@ -566,6 +562,22 @@ The following are names of parameters or literal values and should not be transl NETSDK1170: 為型別程式庫 '{0}' 提供的型別程式庫識別碼 '{1}' 無效。識別碼必須是小於 65536 的正整數。 {StrBegin="NETSDK1170: "} + + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> + {StrBegin="NETSDK1210: "} + + + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + NETSDK1195: IsTrimmable is 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> +For more information, see https://aka.ms/netsdk1195 + {StrBegin="NETSDK1195: "} + NETSDK1157: JIT library '{0}' not found. NETSDK1157: 找不到 JIT 程式庫 '{0}'。 diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index 5900884404df..6cf27944a85a 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -417,14 +417,18 @@ var runtimeRequiredByDeployment { if (AddToolPack(ToolPackType.ILLink, _normalizedTargetFrameworkVersion, packagesToDownload, implicitPackageReferences) is not ToolPackSupport.Supported) { - if (PublishAot || IsAotCompatible || EnableAotAnalyzer) { + if (PublishAot) { Log.LogError(Strings.AotUnsupportedTargetFramework); + } else if (IsAotCompatible || EnableAotAnalyzer) { + Log.LogWarning(Strings.IsAotCompatibleUnsupported); } else if (PublishTrimmed) { - Log.LogWarning(Strings.PublishTrimmedRequiresVersion30); + Log.LogError(Strings.PublishTrimmedRequiresVersion30); } else if (IsTrimmable || EnableTrimAnalyzer) { - Log.LogWarning(Strings.ILLinkNoValidRuntimePackage); - } else if (PublishSingleFile || EnableSingleFileAnalyzer) { - Log.LogWarning(Strings.PublishSingleFileRequiresVersion30); + Log.LogWarning(Strings.IsTrimmableUnsupported); + } else if (PublishSingleFile) { + Log.LogError(Strings.PublishSingleFileRequiresVersion30); + } else if (EnableSingleFileAnalyzer) { + Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported); } } } From 8033c4acf9e8fce9b98ca387bf5931529794a8f3 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 19 Jul 2023 21:51:28 +0000 Subject: [PATCH 13/21] Fix build --- .../GivenThatWeWantToPublishASingleFileApp.cs | 8 ++------ .../GivenThatWeWantToRunILLink.cs | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index f5f6b8f17e89..1e2ef505ec07 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -187,9 +187,7 @@ public void It_errors_when_targetting_netstandard() .Should() .Fail() .And - // Single-file depends on ILLink analyzers, so fails early when trying - // to add the analyzer reference for an unsupported TFM. - .HaveStdOutContaining(Strings.ILLinkNoValidRuntimePackageError) + .HaveStdOutContaining(Strings.PublishSingleFileRequiresVersion30) .And .NotHaveStdOutContaining(Strings.CannotHaveSingleFileWithoutExecutable); } @@ -212,9 +210,7 @@ public void It_errors_when_targetting_netcoreapp_2_x() .Should() .Fail() .And - // Single-file depends on ILLink analyzers, so fails early when trying - // to add the analyzer reference for an unsupported TFM. - .HaveStdOutContaining(Strings.ILLinkNoValidRuntimePackageError); + .HaveStdOutContaining(Strings.PublishSingleFileRequiresVersion30); } [RequiresMSBuildVersionFact("16.8.0")] diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 4c0c60f07a47..e02376bf32f9 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -1843,9 +1843,7 @@ public void It_warns_when_targeting_netcoreapp_2_x_illink() .Should() .Fail() .And - // Fails early when trying to add the illink pack for an - // unsupported TFM. - .HaveStdOutContaining(Strings.ILLinkNoValidRuntimePackageError); + .HaveStdOutContaining(Strings.PublishTrimmedRequiresVersion30); } private void SetMetadata(XDocument project, string assemblyName, string key, string value) From b6a43d9bfb455c782030628a74a59c8bbd521705 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 19 Jul 2023 21:52:33 +0000 Subject: [PATCH 14/21] Remove existing error path --- .../Microsoft.NET.RuntimeIdentifierInference.targets | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index c76f66362028..5eaff95785ab 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -237,18 +237,12 @@ Copyright (c) .NET Foundation. All rights reserved. - - - - Date: Thu, 20 Jul 2023 16:58:13 +0000 Subject: [PATCH 15/21] Consolidate tests, clean up condition --- .../targets/Microsoft.NET.Publish.targets | 9 ++--- .../GivenThatWeWantToRunILLink.cs | 40 +++++-------------- 2 files changed, 12 insertions(+), 37 deletions(-) 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 13aefbb5ec49..27d551c5fb8d 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 @@ -23,12 +23,9 @@ Copyright (c) .NET Foundation. All rights reserved. true true <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == '' And ( - '$(PublishTrimmed)' == 'true' Or - '$(PublishSingleFile)' == 'true' Or - '$(IsTrimmable)' == 'true' Or - '$(EnableAotAnalyzer)' == 'true' Or - '$(EnableTrimAnalyzer)' == 'true' Or - '$(EnableSingleFileAnalyzer)' == 'true')">true + '$(PublishTrimmed)' == 'true' Or '$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or + '$(PublishSingleFile)' == 'true' Or '$(EnableSingleFileAnalyzer)' == 'true' Or + '$(EnableAotAnalyzer)' == 'true')">true <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == ''">false diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index e02376bf32f9..1235add9d97e 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -161,22 +161,26 @@ public void PublishTrimmed_warns_when_no_matching_pack_is_found(string targetFra .And.HaveStdOutContaining("warning NETSDK1124"); } - [RequiresMSBuildVersionFact("17.0.0.32901")] - public void PublishTrimmed_warns_for_unsupported_target_framework() + [RequiresMSBuildVersionTheory("17.0.0.32901")] + [InlineData("netcoreapp2.0")] + [InlineData("netcoreapp2.1")] + [InlineData("netstandard2.1")] + public void PublishTrimmed_fails_for_unsupported_target_framework(string targetFramework) { var projectName = "HelloWorld"; - var targetFramework = "netcoreapp2.1"; var rid = EnvironmentInfo.GetCompatibleRid(targetFramework); var testProject = CreateTestProjectForILLinkTesting(targetFramework, projectName); var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFramework); var publishCommand = new PublishCommand(testAsset); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", "/p:PublishTrimmed=true") - .Should().Pass() - .And.HaveStdOutContaining("warning NETSDK1124"); + .Should().Fail() + .And.HaveStdOutContaining("error NETSDK1124"); } [RequiresMSBuildVersionFact("17.0.0.32901")] + [InlineData("netstandard2.0")] + [InlineData("netstandard2.1")] public void IsTrimmable_warns_for_unsupported_target_framework() { var projectName = "HelloWorld"; @@ -191,32 +195,6 @@ public void IsTrimmable_warns_for_unsupported_target_framework() .And.HaveStdOutContaining("warning NETSDK1195"); } - [RequiresMSBuildVersionTheory("17.0.0.32901")] - [InlineData("netstandard2.0")] - [InlineData("netstandard2.1")] - public void ILLink_fails_on_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:RuntimeIdentifier={rid}", "/p:PublishTrimmed=true") - .Should().Fail() - .And.HaveStdOutContaining("error NETSDK1195"); - - buildCommand.Execute($"/p:RuntimeIdentifier={rid}", "/p:IsTrimmable=true") - .Should().Fail() - .And.HaveStdOutContaining("error NETSDK1195"); - - buildCommand.Execute($"/p:RuntimeIdentifier={rid}", "/p:EnableTrimAnalyzer=true") - .Should().Fail() - .And.HaveStdOutContaining("error NETSDK1195"); - } - [RequiresMSBuildVersionTheory("17.0.0.32901")] [InlineData("netstandard2.0")] [InlineData("netstandard2.1")] From 3a091183062c39948534ba7a905d233ade445b47 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 20 Jul 2023 17:07:02 +0000 Subject: [PATCH 16/21] More cleanup --- .../GivenThatWeWantToRunILLink.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 1235add9d97e..b841a6ffc4bf 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -157,8 +157,8 @@ public void PublishTrimmed_warns_when_no_matching_pack_is_found(string targetFra var publishCommand = new PublishCommand(testAsset); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", "/p:PublishTrimmed=true") - .Should().Pass() - .And.HaveStdOutContaining("warning NETSDK1124"); + .Should().Fail() + .And.HaveStdOutContaining($"error {Strings.PublishTrimmedRequiresVersion30}"); } [RequiresMSBuildVersionTheory("17.0.0.32901")] @@ -175,7 +175,7 @@ public void PublishTrimmed_fails_for_unsupported_target_framework(string targetF var publishCommand = new PublishCommand(testAsset); publishCommand.Execute($"/p:RuntimeIdentifier={rid}", "/p:PublishTrimmed=true") .Should().Fail() - .And.HaveStdOutContaining("error NETSDK1124"); + .And.HaveStdOutContaining($"error {Strings.PublishTrimmedRequiresVersion30}"); } [RequiresMSBuildVersionFact("17.0.0.32901")] @@ -192,7 +192,9 @@ public void IsTrimmable_warns_for_unsupported_target_framework() var buildCommand = new BuildCommand(testAsset); buildCommand.Execute("/p:IsTrimmable=true") .Should().Pass() - .And.HaveStdOutContaining("warning NETSDK1195"); + // Note: can't check for Strings.IsTrimmableUnsupported because each line of + // the message gets prefixed with a file path by MSBuild. + .And.HaveStdOutContaining($"warning NETSDK1195"); } [RequiresMSBuildVersionTheory("17.0.0.32901")] From 6d8869aab904122cd48d64d110019e2547666e4c Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 20 Jul 2023 17:21:34 +0000 Subject: [PATCH 17/21] Add tests for new warnings Also fix some issues with existing tests --- src/Tasks/Common/Resources/Strings.resx | 2 +- .../GivenThatWeWantToPublishASingleFileApp.cs | 19 +++++++++++++ .../GivenThatWeWantToPublishAnAotApp.cs | 21 ++++++++++++++ .../GivenThatWeWantToRunILLink.cs | 28 ++----------------- 4 files changed, 44 insertions(+), 26 deletions(-) diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx index 62fa922839e1..eecd49b0d121 100644 --- a/src/Tasks/Common/Resources/Strings.resx +++ b/src/Tasks/Common/Resources/Strings.resx @@ -948,5 +948,5 @@ For more information, see https://aka.ms/netsdk1195 NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. {StrBegin="NETSDK1211: "} - + diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 1e2ef505ec07..4ec6e29bdc82 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -629,6 +629,25 @@ public void ILLink_analyzer_warnings_are_produced_using_EnableSingleFileAnalyzer .And.HaveStdOutContaining("(10,13): warning IL3001"); } + [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() + .And.HaveStdOutContaining($"warning {Strings.EnableSingleFileAnalyzerUnsupported}"); + } + private TestProject CreateTestProjectWithAnalyzerWarnings(string targetFramework, string projectName, bool isExecutable) { var testProject = new TestProject() diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index a2cda1c69c42..0abef3788919 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -622,6 +622,27 @@ public void IsAotCompatible_implies_enable_analyzers(string targetFramework) .And.NotHaveStdOutContaining("warning IL3002"); } + [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(ToolsetInfo.CurrentTargetFramework)] public void Requires_analyzers_produce_warnings_without_PublishAot_being_set(string targetFramework) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index b841a6ffc4bf..3ab3fd0aaef8 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -140,7 +140,7 @@ public void ILLink_links_simple_app_without_analysis_warnings_and_it_runs(string [RequiresMSBuildVersionTheory("17.0.0.32901")] [InlineData(ToolsetInfo.CurrentTargetFramework)] - public void PublishTrimmed_warns_when_no_matching_pack_is_found(string targetFramework) + public void PublishTrimmed_fails_when_no_matching_pack_is_found(string targetFramework) { var projectName = "HelloWorld"; var rid = EnvironmentInfo.GetCompatibleRid(targetFramework); @@ -178,13 +178,12 @@ public void PublishTrimmed_fails_for_unsupported_target_framework(string targetF .And.HaveStdOutContaining($"error {Strings.PublishTrimmedRequiresVersion30}"); } - [RequiresMSBuildVersionFact("17.0.0.32901")] + [RequiresMSBuildVersionTheory("17.0.0.32901")] [InlineData("netstandard2.0")] [InlineData("netstandard2.1")] - public void IsTrimmable_warns_for_unsupported_target_framework() + public void IsTrimmable_warns_for_unsupported_target_framework(string targetFramework) { var projectName = "HelloWorld"; - var targetFramework = "netstandard2.1"; var rid = EnvironmentInfo.GetCompatibleRid(targetFramework); var testProject = CreateTestProjectForILLinkTesting(targetFramework, projectName); @@ -1805,27 +1804,6 @@ private void RemoveRootDescriptor(XDocument project) .First().Remove(); } - [Fact] - public void It_warns_when_targeting_netcoreapp_2_x_illink() - { - var testProject = new TestProject() - { - Name = "ConsoleApp", - TargetFrameworks = "netcoreapp2.2", - IsExe = true, - }; - - var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: "GivenThatWeWantToRunILLink"); - - var publishCommand = new PublishCommand(testAsset); - - publishCommand.Execute($"/p:PublishTrimmed=true") - .Should() - .Fail() - .And - .HaveStdOutContaining(Strings.PublishTrimmedRequiresVersion30); - } - private void SetMetadata(XDocument project, string assemblyName, string key, string value) { var ns = project.Root.Name.Namespace; From fd0f9eb071bc9e02c7facc82de703bb2f8498f60 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 24 Jul 2023 16:09:27 +0000 Subject: [PATCH 18/21] Don't consider PublishSingleFile PublishSingleFile without EnableSingleFileAnalyzer doesn't require the ILLink pack. Also add some comments, clean up some logic. --- .../ProcessFrameworkReferences.cs | 25 +++++++++++++------ .../targets/Microsoft.NET.Publish.targets | 9 ++++--- ...oft.NET.RuntimeIdentifierInference.targets | 3 +++ ...T.Sdk.FrameworkReferenceResolution.targets | 1 - 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index 91f08710778c..8d51db309f21 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -57,8 +57,6 @@ public class ProcessFrameworkReferences : TaskBase public bool EnableTrimAnalyzer { get; set; } - public bool PublishSingleFile { get; set; } - public bool EnableSingleFileAnalyzer { get; set; } public bool AotUseKnownRuntimePackForTarget { get; set; } @@ -434,25 +432,36 @@ protected override void ExecuteCore() } } - bool requiresILLinkPack = PublishAot || IsAotCompatible || EnableAotAnalyzer - || PublishTrimmed || IsTrimmable || EnableTrimAnalyzer - || PublishSingleFile || EnableSingleFileAnalyzer; - + // Keep this in sync with _RequiresILLinkPack in Microsoft.NET.Publish.targets. + bool requiresILLinkPack = PublishAot + || IsAotCompatible || EnableAotAnalyzer + || PublishTrimmed + || IsTrimmable || EnableTrimAnalyzer + || EnableSingleFileAnalyzer; if (requiresILLinkPack) { if (AddToolPack(ToolPackType.ILLink, _normalizedTargetFrameworkVersion, packagesToDownload, implicitPackageReferences) is not ToolPackSupport.Supported) { if (PublishAot) { + // If PublishAot is set, this should produce a specific error above already. + // Also produce one here just in case there are custom KnownILCompilerPack/KnownILLinkPack + // items that bypass the error above. Log.LogError(Strings.AotUnsupportedTargetFramework); } else if (IsAotCompatible || EnableAotAnalyzer) { + // Technically this is reachable by setting EnableAotAnalyzer without IsAotCompatible, + // but the recommended way to enable AOT analysis is to set IsAotCompatible, + // so the warning points to the common case. Log.LogWarning(Strings.IsAotCompatibleUnsupported); } else if (PublishTrimmed) { Log.LogError(Strings.PublishTrimmedRequiresVersion30); } else if (IsTrimmable || EnableTrimAnalyzer) { + // Technically this is reachable by setting EnableTrimAnalyzer without IsTrimmable, + // but the recommended way to enable trim analysis is to set IsTrimmable, + // so the warning points to the common case. Log.LogWarning(Strings.IsTrimmableUnsupported); - } else if (PublishSingleFile) { - Log.LogError(Strings.PublishSingleFileRequiresVersion30); } else if (EnableSingleFileAnalyzer) { + // There's no IsSingleFileCompatible setting. EnableSingleFileAnalyzer is the + // recommended way to ensure single-file compatibility for libraries. Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported); } } 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 27d551c5fb8d..883bbe46a621 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 @@ -22,10 +22,13 @@ Copyright (c) .NET Foundation. All rights reserved. true true + <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == '' And ( - '$(PublishTrimmed)' == 'true' Or '$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or - '$(PublishSingleFile)' == 'true' Or '$(EnableSingleFileAnalyzer)' == 'true' Or - '$(EnableAotAnalyzer)' == 'true')">true + '$(PublishAot)' == 'true' Or + '$(IsAotCompatible)' == 'true' Or '$(EnableAotAnalyzer)' == 'true' Or + '$(PublishTrimmed)' == 'true' Or + '$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or + '$(EnableSingleFileAnalyzer)' == 'true')">true <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == ''">false diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index 5eaff95785ab..72880b4b84ea 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -237,6 +237,9 @@ Copyright (c) .NET Foundation. All rights reserved. + + 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 65d6a28cf0ac..8b32ba911b3c 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 @@ -105,7 +105,6 @@ Copyright (c) .NET Foundation. All rights reserved. PublishTrimmed="$(PublishTrimmed)" IsTrimmable="$(IsTrimmable)" EnableTrimAnalyzer="$(EnableTrimAnalyzer)" - PublishSingleFile="$(PublishSingleFile)" EnableSingleFileAnalyzer="$(EnableSingleFileAnalyzer)" AotUseKnownRuntimePackForTarget="$(PublishAotUsingRuntimePack)" RuntimeIdentifier="$(RuntimeIdentifier)" From 721fdd209cc3a29cd7f571598a230a06b1ffb635 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 24 Jul 2023 18:01:49 +0000 Subject: [PATCH 19/21] Revert single-file test changes --- .../GivenThatWeWantToPublishASingleFileApp.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 4ec6e29bdc82..19ce5be5367f 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -152,7 +152,7 @@ public void It_errors_when_publishing_single_file_lib() var testProject = new TestProject() { Name = "ClassLib", - TargetFrameworks = "netcoreapp3.0", + TargetFrameworks = "netstandard2.0", IsExe = false, }; @@ -187,7 +187,7 @@ public void It_errors_when_targetting_netstandard() .Should() .Fail() .And - .HaveStdOutContaining(Strings.PublishSingleFileRequiresVersion30) + .HaveStdOutContaining(Strings.CanOnlyHaveSingleFileWithNetCoreApp) .And .NotHaveStdOutContaining(Strings.CannotHaveSingleFileWithoutExecutable); } From c068281a95a22c43af89edc98db8ea75c67d50cc Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 27 Jul 2023 16:20:51 +0000 Subject: [PATCH 20/21] PR feedback - net7.0 for AOT - Add IsTargetFrameworkCompatible to message for single-file analysis --- src/Tasks/Common/Resources/Strings.resx | 5 +++-- src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.de.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.es.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.it.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf | 10 ++++++---- src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf | 10 ++++++---- 14 files changed, 81 insertions(+), 54 deletions(-) diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx index eecd49b0d121..c5cf719323df 100644 --- a/src/Tasks/Common/Resources/Strings.resx +++ b/src/Tasks/Common/Resources/Strings.resx @@ -941,11 +941,12 @@ For more information, see https://aka.ms/netsdk1195 NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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> {StrBegin="NETSDK1211: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index 025e20721e68..b62326881a85 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index 0cf2af1634f1..afa0d1e2a5ba 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index 599016e71f5c..4f602c72f430 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index 45e8aa34cc1e..8e686efd25e5 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index 844830035d25..8dafe9ed3e56 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index ef45af6ff85f..8999100d2fab 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index 269cdaad2e0e..88ecc253eafd 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index e6348fda6a9f..872df5d9b7e2 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index 8684418327a4..3507a639a1de 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index fc65dd7ae714..4530898b828f 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index e855996b0e56..4ae0b9eaa681 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index ef6f2030aff2..538c3f7e4bd2 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index d4fbdc680a3d..91874517317e 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -400,8 +400,10 @@ {StrBegin="NETSDK1169: "} - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. - NETSDK1211: EnableSingleFileAnalyzer is not supported for the target framework. + 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 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> {StrBegin="NETSDK1211: "} @@ -564,9 +566,9 @@ The following are names of parameters or literal values and should not be transl NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> NETSDK1210: IsAotCompatible is 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)', 'net6.0'))">true</IsAotCompatible> +<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible> {StrBegin="NETSDK1210: "} From 673052aa33e6a0aff4f4a421c9e9a9bee07ddb4a Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 27 Jul 2023 18:42:54 +0000 Subject: [PATCH 21/21] Fix test --- .../GivenThatWeWantToPublishASingleFileApp.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 19ce5be5367f..f1ec790a621c 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -645,7 +645,9 @@ public void EnableSingleFileAnalyzer_warns_for_unsupported_target_framework(stri buildCommand .Execute() .Should().Pass() - .And.HaveStdOutContaining($"warning {Strings.EnableSingleFileAnalyzerUnsupported}"); + // 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"); } private TestProject CreateTestProjectWithAnalyzerWarnings(string targetFramework, string projectName, bool isExecutable)