-
Notifications
You must be signed in to change notification settings - Fork 733
Set RuntimeIdentifier when building dotnet containers #12936
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
base: main
Are you sure you want to change the base?
Conversation
Set both RuntimeIdentifier/ContainerRuntimeIdentifier or RuntimeIdentifiers/ContainerRuntimeIdentifiers when building dotnet containers. This way the application is published correctly - for example for native AOT.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12936Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12936" |
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 enhances container image building for .NET projects by setting both RuntimeIdentifier/RuntimeIdentifiers and ContainerRuntimeIdentifier/ContainerRuntimeIdentifiers MSBuild properties when building dotnet containers. This ensures applications are published correctly for scenarios like Native AOT compilation. Additionally, the PR removes the ContainerRegistry property from several playground TestShop project files.
Key changes:
- Sets
RuntimeIdentifieralongsideContainerRuntimeIdentifierfor single-platform builds - Sets
RuntimeIdentifiersalongsideContainerRuntimeIdentifiersfor multi-platform builds - Removes unused
ContainerRegistryproperty from three TestShop playground projects
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs | Adds RuntimeIdentifier/RuntimeIdentifiers properties to dotnet publish command for both single and multi-platform builds |
| playground/TestShop/MyFrontend/MyFrontend.csproj | Removes ContainerRegistry property from project file |
| playground/TestShop/CatalogService/CatalogService.csproj | Removes ContainerRegistry property from project file |
| playground/TestShop/BasketService/BasketService.csproj | Removes ContainerRegistry property from project file |
| <PropertyGroup> | ||
| <TargetFramework>$(DefaultTargetFramework)</TargetFramework> | ||
| <UserSecretsId>f0611710-1eab-4ff6-a476-9610bb7a8416</UserSecretsId> | ||
| <ContainerRegistry>localhost:5001</ContainerRegistry> |
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.
Why does this need to be removed?
Description
Set both RuntimeIdentifier/ContainerRuntimeIdentifier or RuntimeIdentifiers/ContainerRuntimeIdentifiers when building dotnet containers. This way the application is published correctly - for example for native AOT.