From b15c0295b3078b6efef2794d4b0b0b41182aab0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Jun 2025 20:54:10 +0000 Subject: [PATCH 1/6] Initial plan From 22fb6bc70a53db5509b632a584fbf69e348f62cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Jun 2025 21:04:24 +0000 Subject: [PATCH 2/6] Add .NET 6.0 to EOL frameworks list Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- .../targets/Microsoft.NET.EolTargetFrameworks.targets | 4 ++-- .../GivenThatWeWantToTargetEolFrameworks.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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 8608d9f77a33..6f03a1ca4ae3 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,10 +21,10 @@ 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;7.0" /> + <_EolNetCoreTargetFrameworkVersions Include="1.0;1.1;2.0;2.1;2.2;3.0;3.1;5.0;6.0;7.0" /> - <_MinimumNonEolSupportedNetCoreTargetFramework>net6.0 + <_MinimumNonEolSupportedNetCoreTargetFramework>net8.0 Date: Tue, 24 Jun 2025 00:01:32 +0000 Subject: [PATCH 3/6] Fix failing tests by suppressing .NET 6.0 EOL warnings Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- .../GivenThatWeWantToPublishASingleFileApp.cs | 1 + .../GivenThatWeWantToPublishAnAotApp.cs | 1 + test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs | 2 +- test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 2465c9ec0aa1..f51ef7e34fd7 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -749,6 +749,7 @@ public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted TargetFrameworks = targetFrameworks }; testProject.AdditionalProperties["EnableSingleFileAnalyzer"] = "true"; + testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index 7963c9924869..ac25974b245e 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -660,6 +660,7 @@ public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_li TargetFrameworks = targetFrameworks }; testProject.AdditionalProperties["IsAotCompatible"] = "true"; + testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 2f4bc33dd4f1..0354d83cf427 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -200,7 +200,7 @@ public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libr var testProject = CreateTestProjectForILLinkTesting(_testAssetsManager, targetFrameworks, projectName); testProject.AdditionalProperties["IsTrimmable"] = "true"; - testProject.AdditionalProperties["NoWarn"] = "NETSDK1138"; // Silence warning about targeting EOL TFMs + testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); diff --git a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs index 568ca11f6a03..aeb902cfefbe 100644 --- a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs +++ b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs @@ -420,7 +420,7 @@ public async Task FeaturesSupport( { new DotnetBuildCommand(_log, "MyProject") .WithWorkingDirectory(workingDir) - .Execute() + .Execute("/p:CheckEolTargetFramework=false") .Should() .Pass() .And.NotHaveStdErr(); From 362a2d1820e2540dd49cd68b999981794ab44d6e Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Tue, 24 Jun 2025 16:47:43 -0700 Subject: [PATCH 4/6] Disable the EOL check for multiple tests --- .../GivenThatWeWantToPublishASingleFileApp.cs | 3 ++- .../GivenThatWeWantToPublishAnAotApp.cs | 1 + test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs | 2 ++ test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index f51ef7e34fd7..bfa9c70cb867 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -752,7 +752,8 @@ public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); - + testAsset.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs + var buildCommand = new BuildCommand(testAsset); var resultAssertion = buildCommand.Execute("/bl:my.binlog") .Should().Pass(); diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index ac25974b245e..374781e77a7c 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -663,6 +663,7 @@ public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_li testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); + testAsset.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var buildCommand = new BuildCommand(testAsset); var resultAssertion = buildCommand.Execute() diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 0354d83cf427..5e53e4288f11 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -204,6 +204,8 @@ public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libr var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); + testAsset.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs + var buildCommand = new BuildCommand(testAsset); var resultAssertion = buildCommand.Execute() .Should().Pass(); diff --git a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs index aeb902cfefbe..ad1499294f64 100644 --- a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs +++ b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs @@ -386,6 +386,7 @@ public async Task FeaturesSupport( string finalProjectName = Path.Combine(projectDir, $"{projName}.{extension}"); Dictionary environmentUnderTest = new() { ["DOTNET_NOLOGO"] = false.ToString() }; + environmentUnderTest["CheckEolTargetFramework"] = false.ToString(); TestContext.Current.AddTestEnvironmentVariables(environmentUnderTest); TemplateVerifierOptions options = new TemplateVerifierOptions(templateName: name) From 470c6f6d582d0ac282559ae9bb99ea85dd4b7fa5 Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Fri, 27 Jun 2025 11:46:05 -0700 Subject: [PATCH 5/6] Fix how we set the EOL property for the build --- .../GivenThatWeWantToPublishASingleFileApp.cs | 3 +-- .../GivenThatWeWantToPublishAnAotApp.cs | 3 +-- .../Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index bfa9c70cb867..63d7243f41a4 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -752,10 +752,9 @@ public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); - testAsset.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var buildCommand = new BuildCommand(testAsset); - var resultAssertion = buildCommand.Execute("/bl:my.binlog") + var resultAssertion = buildCommand.Execute("/bl:my.binlog /p:CheckEolTargetFramework=false") .Should().Pass(); if (shouldWarn) { // Note: can't check for Strings.EnableSingleFileAnalyzerUnsupported because each line of diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index 374781e77a7c..272b15016b36 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -663,10 +663,9 @@ public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_li testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); - testAsset.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs var buildCommand = new BuildCommand(testAsset); - var resultAssertion = buildCommand.Execute() + var resultAssertion = buildCommand.Execute("/p:CheckEolTargetFramework=false") .Should().Pass(); if (shouldWarn) { resultAssertion diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 5e53e4288f11..89c9c15a667b 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -204,10 +204,8 @@ public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libr var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks) .WithProjectChanges(AddTargetFrameworkAliases); - testAsset.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs - var buildCommand = new BuildCommand(testAsset); - var resultAssertion = buildCommand.Execute() + var resultAssertion = buildCommand.Execute("/p:CheckEolTargetFramework=false") .Should().Pass(); if (shouldWarn) { resultAssertion From 11065e7964f64846399fc57ff8d2d04b67406d51 Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Fri, 27 Jun 2025 15:49:48 -0700 Subject: [PATCH 6/6] Fix the publish tests to expect net8 as the minimum and slightly change the tests run --- .../GivenThatWeWantToPublishASingleFileApp.cs | 7 ++++--- .../GivenThatWeWantToPublishAnAotApp.cs | 5 +++-- .../GivenThatWeWantToRunILLink.cs | 7 ++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs index 63d7243f41a4..fffa718864f9 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs @@ -736,7 +736,8 @@ public void PublishSingleFile_fails_for_unsupported_target_framework(string targ [InlineData("net6.0", false)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for single-file [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for single-file and targeting. - [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for single-file, but leaves a "gap" for the supported net6./net7.0 TFMs. + [InlineData("netstandard2.0;net8.0", false)] // Net8.0 is supported for single-file + [InlineData("netstandard2.0;net9.0", true)] // Net9.0 is supported for single-file, but leaves a "gap" for the supported net6./net7.0 TFMs. [InlineData("alias-ns2", true)] [InlineData("alias-n6", false)] [InlineData("alias-n6;alias-n8", false)] // If all TFMs are supported, there's no warning even though the project uses aliases. @@ -754,14 +755,14 @@ public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted .WithProjectChanges(AddTargetFrameworkAliases); var buildCommand = new BuildCommand(testAsset); - var resultAssertion = buildCommand.Execute("/bl:my.binlog /p:CheckEolTargetFramework=false") + var resultAssertion = buildCommand.Execute("/p:CheckEolTargetFramework=false") .Should().Pass(); if (shouldWarn) { // Note: can't check for Strings.EnableSingleFileAnalyzerUnsupported because each line of // the message gets prefixed with a file path by MSBuild. resultAssertion .And.HaveStdOutContaining($"warning NETSDK1211") - .And.HaveStdOutContaining($"true"); + .And.HaveStdOutContaining($"true"); } else { resultAssertion.And.NotHaveStdOutContaining($"warning"); } diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index 272b15016b36..a87d3e8f3ee8 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -644,7 +644,8 @@ public void PublishAot_fails_for_unsupported_target_framework(string targetFrame [InlineData("net7.0", false)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for AOT [InlineData("netstandard2.0;net7.0", false)] // Net7.0 is the min TFM supported for AOT and targeting. - [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for AOT, but leaves a "gap" for the supported net7.0 TFMs. + [InlineData("netstandard2.0;net8.0", false)] // net8.0 is supported for AOT and targeting. + [InlineData("netstandard2.0;net9.0", true)] // Net9.0 is supported for AOT, but leaves a "gap" for the supported net8.0 TFMs. [InlineData("alias-ns2", true)] [InlineData("alias-n6", true)] [InlineData("alias-n7", false)] @@ -672,7 +673,7 @@ public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_li // Note: can't check for Strings.IsAotCompatibleUnsupported because each line of // the message gets prefixed with a file path by MSBuild. .And.HaveStdOutContaining($"warning NETSDK1210") - .And.HaveStdOutContaining($"true"); + .And.HaveStdOutContaining($"true"); } else { resultAssertion.And.NotHaveStdOutContaining($"warning"); } diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs index 89c9c15a667b..314a8c66789c 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @@ -187,8 +187,9 @@ public void PublishTrimmed_fails_for_unsupported_target_framework(string targetF [InlineData("net5.0", true)] [InlineData("net6.0", false)] [InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for trimming - [InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for trimming and targeting. - [InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for trimming, but leaves a "gap" for the supported net6.0/net7.0 TFMs. + [InlineData("netstandard2.0;net6.0", false)] // net6.0 is the min TFM supported for trimming and targeting. + [InlineData("netstandard2.0;net8.0", false)] // Net8.0 is supported for trimming and targeting. + [InlineData("netstandard2.0;net9.0", true)] // Net8.0 is supported for trimming, but leaves a "gap" for the supported net6.0/net7.0 TFMs. [InlineData("alias-ns2", true)] [InlineData("alias-n6", false)] [InlineData("alias-n6;alias-n8", false)] // If all TFMs are supported, there's no warning even though the project uses aliases. @@ -212,7 +213,7 @@ public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libr // Note: can't check for Strings.IsTrimmableUnsupported because each line of // the message gets prefixed with a file path by MSBuild. .And.HaveStdOutContaining($"warning NETSDK1212") - .And.HaveStdOutContaining($"true"); + .And.HaveStdOutContaining($"true"); } else { resultAssertion.And.NotHaveStdOutContaining($"warning"); }