Skip to content

Fix Ubuntu codename resolution for .NET 11#53371

Open
hwoodiwiss wants to merge 9 commits intodotnet:release/11.0.1xx-preview4from
hwoodiwiss:hw-fix-ubuntu-codename
Open

Fix Ubuntu codename resolution for .NET 11#53371
hwoodiwiss wants to merge 9 commits intodotnet:release/11.0.1xx-preview4from
hwoodiwiss:hw-fix-ubuntu-codename

Conversation

@hwoodiwiss
Copy link
Copy Markdown
Contributor

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

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
@github-actions github-actions Bot added the Area-Containers Related to dotnet SDK containers functionality label Mar 11, 2026
@lbussell
Copy link
Copy Markdown
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).

Copilot AI review requested due to automatic review settings April 20, 2026 18:54
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 resolute for .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.

Comment thread test/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs Outdated
Comment thread test/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs Outdated
@lbussell lbussell changed the base branch from main to release/11.0.1xx-preview4 April 24, 2026 16:33
lbussell and others added 5 commits April 24, 2026 09:35
- 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>
@lbussell
Copy link
Copy Markdown
Member

I updated the behavior as follows. When building with a .NET 11 Preview SDK:

TFM Publish Mode Container Base Image
net10.0 Default mcr.microsoft.com/dotnet/runtime:10.0
net10.0 AOT, Invariant Globalization mcr.microsoft.com/dotnet/runtime-deps:10.0-noble-chiseled
net10.0 Trimmed, Invariant Globalization mcr.microsoft.com/dotnet/runtime-deps:10.0-noble-chiseled
net10.0 Family=noble-chiseled mcr.microsoft.com/dotnet/runtime:10.0-noble-chiseled
net11.0 Default mcr.microsoft.com/dotnet/runtime:11.0-preview
net11.0 Family=resolute-chiseled mcr.microsoft.com/dotnet/runtime:11.0-preview-resolute-chiseled
net11.0 AOT, Invariant Globalization mcr.microsoft.com/dotnet/runtime-deps:11.0-preview-resolute-chiseled

@lbussell lbussell requested a review from mthalman April 28, 2026 18:10
@lbussell lbussell enabled auto-merge (squash) April 28, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Containers Related to dotnet SDK containers functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect Ubuntu Codename selected for .NET 11 builds

4 participants