-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add .NET 6.0 to End-of-Life frameworks list to generate NETSDK1138 warnings #49533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: marcpopMSFT <[email protected]>
@copilot a bunch of tests are failing because they aren't expecting the new warning. The easiest solution is to set CheckEolTargetFramework to false in any of these tests to suppress the warning for that specific test. This can be done during the build step or as an environment variable. Please apply that change to the following failing tests: |
Co-authored-by: marcpopMSFT <[email protected]>
Fixed all four failing tests by adding
All tests now build successfully without the unexpected NETSDK1138 warnings. Commit: 5279382 |
@copilot I tried to fix a few tests but the testAsset doesn't have the additionaproperties option. Instead, can you remove that call I added and add /p:CheckEolTargetFramework=false to the Execute call on the testAsset buildCommand? |
@copilot I tried to fix a few tests but the testAsset doesn't have the additionaproperties option. Instead, can you remove that call I added and add /p:CheckEolTargetFramework=false to the Execute call on the testAsset buildCommand? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds .NET 6.0 to the list of End-of-Life target frameworks so that executable projects targeting it generate NETSDK1138 warnings, and it updates the minimum supported target framework from net6.0 to net8.0. Key changes include:
- Updating the _EolNetCoreTargetFrameworkVersions list and _MinimumNonEolSupportedNetCoreTargetFramework property in Microsoft.NET.EolTargetFrameworks.targets.
- Adjusting test cases in multiple test files to handle the new behavior by suppressing the EOL framework warning via the CheckEolTargetFramework property.
- Modifying inline data and expected warning conditions in tests for ILLink, AOT, and single-file publishing scenarios.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs | Sets the CheckEolTargetFramework flag via environment variables and command-line parameters to suppress warnings. |
test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs | Updates inline test data and modifies the build command parameter to match the new behavior for EOL framework checks. |
test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs | Adjusts test properties and expected log output to use the new CheckEolTargetFramework setting. |
test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs | Changes inline data and build command parameters for single-file app publishing tests with the updated EOL check. |
test/Microsoft.NET.Build.Tests/GivenThatWeWantToTargetEolFrameworks.cs | Adds a new test case for net6.0 to verify that an appropriate warning is generated. |
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.EolTargetFrameworks.targets | Incorporates .NET 6.0 in the list of EOL frameworks and updates the minimum supported target to net8.0. |
Comments suppressed due to low confidence (1)
test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs:758
- [nitpick] The change from using a binary log parameter to explicitly setting '/p:CheckEolTargetFramework=false' may reduce diagnostic logging. Confirm that any necessary build diagnostics are maintained for troubleshooting purposes.
var resultAssertion = buildCommand.Execute("/p:CheckEolTargetFramework=false")
@agocke I had to adjust the publish tests if you wanted to take a look. This change will eventually go into 8 and 9 servicing as we'll want the build warning there as well but starting in main. |
/backport to release/8.0.1xx |
/backport to release/9.0.1xx |
Started backporting to release/8.0.1xx: https://github.com/dotnet/sdk/actions/runs/16331124062 |
Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/16331125825 |
@marcpopMSFT backporting to "release/8.0.1xx" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Creating an empty commit: Initial plan
Applying: Add .NET 6.0 to EOL frameworks list
Using index info to reconstruct a base tree...
A test/Microsoft.NET.Build.Tests/GivenThatWeWantToTargetEolFrameworks.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToTargetEolFrameworks.cs
Applying: Fix failing tests by suppressing .NET 6.0 EOL warnings
Using index info to reconstruct a base tree...
A test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs
A test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs
A test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs
A test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs
Auto-merging src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs
Auto-merging src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs
CONFLICT (content): Merge conflict in src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs
Auto-merging src/Tests/dotnet-new.Tests/CommonTemplatesTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0003 Fix failing tests by suppressing .NET 6.0 EOL warnings
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
…rnings (#49533) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: marcpopMSFT <[email protected]> Co-authored-by: Marc Paine <[email protected]>
This change adds .NET 6.0 to the list of End-of-Life (EOL) target frameworks that generate NETSDK1138 warnings when used in executable projects.
Background
.NET 6.0 went End-of-Life when .NET 9 was released in November 2024. Following the established policy of adding build warnings 6 months after a runtime goes out of support, .NET 6.0 should now generate NETSDK1138 warnings to inform developers that the framework is no longer supported and will not receive security updates.
Changes Made
Microsoft.NET.EolTargetFrameworks.targets:
_EolNetCoreTargetFrameworkVersions
list_MinimumNonEolSupportedNetCoreTargetFramework
from net6.0 to net8.0GivenThatWeWantToTargetEolFrameworks.cs:
Verification
Example warning output:
The changes are minimal and follow the established pattern used for other EOL frameworks.
Fixes #46640.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
5dkvsblobprodcus355.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---563B29FA/Eolnetcoreapp3.0/Eolnetcoreapp3.0.csproj /restore
(dns block)5rqvsblobprodcus385.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---B79EB584/Eolnetcoreapp3.1/Eolnetcoreapp3.1.csproj /restore
(dns block)bcnvsblobprodcus378.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---FBC98025/Eolnet7.0/Eolnet7.0.csproj /restore
(dns block)/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---B79EB584/Eolnetcoreapp3.1/Eolnetcoreapp3.1.csproj /restore
(dns block)d0svsblobprodcus381.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---FBC98025/Eolnet7.0/Eolnet7.0.csproj /restore
(dns block)dlbvsblobprodcus316.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/.nuget/packages/microsoft.dotnet.arcade.sdk/10.0.0-beta.25316.103/tools/Build.proj /p:Configuration=Debug /p:RepoRoot=/home/REDACTED/work/sdk/sdk/ /p:Restore=true /p:Build=true /p:DotNetBuild=false /p:DotNetBuildSourceOnly=false /p:DotNetBuildFromVMR=false /p:Rebuild=false /p:Test=true /p:Pack=true /p:IntegrationTest=false /p:PerformanceTest=false /p:Sign=false /p:Publish=false /p:RestoreStaticGraphEnableBinaryLogger=false
(dns block)/home/REDACTED/work/sdk/sdk/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/.nuget/packages/microsoft.dotnet.arcade.sdk/10.0.0-beta.25316.103/tools/Build.proj /p:Configuration=Debug /p:RepoRoot=/home/REDACTED/work/sdk/sdk/ /p:Restore=true /p:Build=false /p:DotNetBuild=false /p:DotNetBuildSourceOnly=false /p:DotNetBuildFromVMR=false /p:Rebuild=false /p:Test=false /p:Pack=false /p:IntegrationTest=false /p:PerformanceTest=false /p:Sign=false /p:Publish=false /p:RestoreStaticGraphEnableBinaryLogger=false
(dns block)/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---F026DC2E/Eolnet5.0/Eolnet5.0.csproj /restore
(dns block)gbsvsblobprodcus365.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---563B29FA/Eolnetcoreapp3.0/Eolnetcoreapp3.0.csproj /restore
(dns block)ibzvsblobprodcus369.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---2D57930A/Eolnetcoreapp2.1/Eolnetcoreapp2.1.csproj /restore
(dns block)jrqvsblobprodcus343.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---F026DC2E/Eolnet5.0/Eolnet5.0.csproj /restore
(dns block)kh4vsblobprodcus325.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---B79EB584/Eolnetcoreapp3.1/Eolnetcoreapp3.1.csproj /restore
(dns block)ljcvsblobprodcus317.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---563B29FA/Eolnetcoreapp3.0/Eolnetcoreapp3.0.csproj /restore
(dns block)pe3vsblobprodcus354.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---FBC98025/Eolnet7.0/Eolnet7.0.csproj /restore
(dns block)vwvvsblobprodcus334.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---F026DC2E/Eolnet5.0/Eolnet5.0.csproj /restore
(dns block)yttvsblobprodcus357.vsblob.vsassets.io
/home/REDACTED/work/sdk/sdk/artifacts/bin/redist/Debug/dotnet/dotnet msbuild /t:Build /home/REDACTED/work/sdk/sdk/artifacts/tmp/Debug/It_warns_that---DEB8488B/Eolnetcoreapp1.0/Eolnetcoreapp1.0.csproj /restore
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.