Fix Ubuntu codename resolution for .NET 11#53371
Open
hwoodiwiss wants to merge 9 commits intodotnet:release/11.0.1xx-preview4from
Open
Fix Ubuntu codename resolution for .NET 11#53371hwoodiwiss wants to merge 9 commits intodotnet:release/11.0.1xx-preview4from
hwoodiwiss wants to merge 9 commits intodotnet:release/11.0.1xx-preview4from
Conversation
Updates ubuntu codename resolution to take into account the change from noble to resolute. This should fix SDK container builds for .NET 11. Fixes dotnet#53370
This was referenced Mar 11, 2026
This was referenced Mar 11, 2026
Open
Member
|
Hey @hwoodiwiss, thanks for the contribution, sorry we missed this for Preview 3! We'll get it in for Preview 4. I'm going to take over this PR and get it merged. Hopefully I can refactor this soon so that manual updates aren't required here (or aren't required as frequently). |
lbussell
approved these changes
Apr 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SDK container base-image inference logic to use the new Ubuntu codename (resolute) for .NET 11, aiming to fix container builds that currently resolve to the wrong runtime-deps tag.
Changes:
- Update Ubuntu codename selection to return
resolutefor .NET 11 SDK versions. - Add/adjust integration test cases to cover .NET 11 container-family/tag expectations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| test/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs | Adds new InlineData cases for .NET 11-related tag/image expectations. |
| src/Containers/Microsoft.NET.Build.Containers/Tasks/ComputeDotnetBaseImageAndTag.cs | Updates Ubuntu codename inference to introduce resolute for .NET 11. |
- Change UbuntuCodenameForSDKVersion to use version.Major >= 11 instead of version >= 11.0.100 so preview SDKs correctly resolve to resolute - Fix wrong test expectations: remove erroneous -extra on prerelease, fix bare resolute family expected tag - Add tests for .NET 11 SDK version tag computation and AOT codename inference Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AOT/trimmed net10 apps built with .NET 11 SDK should use noble (matching the net10 base image), not resolute (which matches the .NET 11 SDK). These tests currently fail and will be fixed in the next commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Ubuntu codename for container base images must match the TFM, not the SDK version. A net10 app must always use noble regardless of whether it is built with the .NET 10 or .NET 11 SDK, because the runtime:10.0 base image is noble and switching to AOT/chiseled must not change the base OS. The SDK version is still used for net8.0 where SDK 8.0.300 switched from jammy to noble within the same major version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
I updated the behavior as follows. When building with a .NET 11 Preview SDK:
|
mthalman
approved these changes
Apr 28, 2026
mthalman
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates ubuntu codename resolution to take into account the change from noble to resolute. This should fix SDK container builds for .NET 11.
Fixes #53370