From fd149da0dd5292c91ee90a468a229d2bb426d182 Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Fri, 13 Sep 2024 13:36:47 -0700 Subject: [PATCH 1/2] Expand EOL list to include net7 6 months after it goes OOS per design --- .../targets/Microsoft.NET.EolTargetFrameworks.targets | 2 +- .../GivenThatWeWantToTargetEolFrameworks.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets index d9bd74aa368f..8608d9f77a33 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets @@ -21,7 +21,7 @@ Copyright (c) .NET Foundation. All rights reserved. receive servicing updates and security fixes. --> - <_EolNetCoreTargetFrameworkVersions Include="1.0;1.1;2.0;2.1;2.2;3.0;3.1;5.0" /> + <_EolNetCoreTargetFrameworkVersions Include="1.0;1.1;2.0;2.1;2.2;3.0;3.1;5.0;7.0" /> <_MinimumNonEolSupportedNetCoreTargetFramework>net6.0 diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToTargetEolFrameworks.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToTargetEolFrameworks.cs index 9f196512336e..6e020c0df98f 100644 --- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToTargetEolFrameworks.cs +++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToTargetEolFrameworks.cs @@ -15,6 +15,7 @@ public GivenThatWeWantToTargetEolFrameworks(ITestOutputHelper log) : base(log) [InlineData("netcoreapp3.0")] [InlineData("netcoreapp3.1")] [InlineData("net5.0")] + [InlineData("net7.0")] public void It_warns_that_framework_is_out_of_support(string targetFrameworks) { var testProject = new TestProject() From 95222773f34500cce74ed48c702397c2809cc9f8 Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Mon, 16 Sep 2024 10:23:15 -0700 Subject: [PATCH 2/2] Remove 7.0 from the templating tests Disable the EOL message for two publishing tests --- .../GivenThatWeWantToPublishAnAotApp.cs | 4 ++-- src/Tests/dotnet-new.Tests/CommonTemplatesTests.cs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index ea382026a18b..d136a7f9e3d4 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -43,7 +43,7 @@ public void NativeAot_hw_runs_with_no_warnings_when_PublishAot_is_enabled(string var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); publishCommand - .Execute($"/p:UseCurrentRuntimeIdentifier=true", "/p:SelfContained=true") + .Execute($"/p:UseCurrentRuntimeIdentifier=true", "/p:SelfContained=true", "/p:CheckEolTargetFramework=false") .Should().Pass() .And.NotHaveStdOutContaining("IL2026") .And.NotHaveStdErrContaining("NETSDK1179") @@ -87,7 +87,7 @@ public void NativeAot_hw_runs_with_no_warnings_when_PublishAot_is_false(string t var publishCommand = new PublishCommand(testAsset); publishCommand - .Execute($"/p:RuntimeIdentifier={rid}", "/p:SelfContained=true") + .Execute($"/p:RuntimeIdentifier={rid}", "/p:SelfContained=true", "/p:CheckEolTargetFramework=false") .Should().Pass() .And.NotHaveStdOutContaining("IL2026") .And.NotHaveStdErrContaining("NETSDK1179") diff --git a/src/Tests/dotnet-new.Tests/CommonTemplatesTests.cs b/src/Tests/dotnet-new.Tests/CommonTemplatesTests.cs index 21bd69d702aa..aaa2da896b15 100644 --- a/src/Tests/dotnet-new.Tests/CommonTemplatesTests.cs +++ b/src/Tests/dotnet-new.Tests/CommonTemplatesTests.cs @@ -230,8 +230,8 @@ public async void AotVariants(string name, string language) var templatesToTest = new[] { - new { Template = consoleTemplateShortname, Frameworks = new[] { null, "net6.0", "net7.0", "net8.0" } }, - new { Template = "classlib", Frameworks = new[] { null, "net6.0", "net7.0", "net8.0", "netstandard2.0", "netstandard2.1" } } + new { Template = consoleTemplateShortname, Frameworks = new[] { null, "net6.0", "net8.0" } }, + new { Template = "classlib", Frameworks = new[] { null, "net6.0", "net8.0", "netstandard2.0", "netstandard2.1" } } }; //features: top-level statements; nullables; implicit usings; filescoped namespaces @@ -240,9 +240,9 @@ public async void AotVariants(string name, string language) //C# 12 is not supported yet - https://github.com/dotnet/sdk/issues/29195 string?[] supportedLanguageVersions = { null, "ISO-2", "2", "3", "4", "5", "6", "7", "7.1", "7.2", "7.3", "8.0", "9.0", "10.0", "11.0", "11", /*"12",*/ "latest", "latestMajor", "default", "preview" }; - string?[] nullableSupportedInFrameworkByDefault = { null, "net6.0", "net7.0", "net8.0", "netstandard2.1" }; - string?[] implicitUsingsSupportedInFramework = { null, "net6.0", "net7.0", "net8.0" }; - string?[] fileScopedNamespacesSupportedFrameworkByDefault = { null, "net6.0", "net7.0", "net8.0" }; + string?[] nullableSupportedInFrameworkByDefault = { null, "net6.0", "net8.0", "netstandard2.1" }; + string?[] implicitUsingsSupportedInFramework = { null, "net6.0", "net8.0" }; + string?[] fileScopedNamespacesSupportedFrameworkByDefault = { null, "net6.0", "net8.0" }; string?[] nullableSupportedLanguages = { "8.0", "9.0", "10.0", "11.0", "11", /*"12",*/ "latest", "latestMajor", "default", "preview" }; string?[] topLevelStatementSupportedLanguages = { null, "9.0", "10.0", "11", "11.0", /*"12",*/ "latest", "latestMajor", "default", "preview" };