Skip to content

Conversation

DamianEdwards
Copy link
Member

@DamianEdwards DamianEdwards commented Oct 22, 2025

Description

Updates the Aspire templates for .NET 10:

  • The net10.0 target framework is now the default for all Aspire templates. Users using the Aspire 13 templates on .NET 8 or .NET 9 SDKs will need to pass -f net8.0 or -f net9.0 to create projects that run on the runtime matching their SDK version.
  • All Aspire AppHost templates have been updated to use a *.dev.localhost URL by default, e.g. mygreataspireapp_apphost.dev.localhost
  • Updated configuration of single-file apphost template to ensure it doesn't show up in VS and functions correctly from the dotnet new experience
  • Tweaks default logic in ApplicationOrchestrator so that resource URLs for *.localhost are given priority in the dashboard, showing in the resource summary page and hiding the plain localhost URL from the summary. Both URLs show in the resource details pane.
  • Fixes issue with empty Aspire template where Aspire version selector wasn't being shown when targeting .NET 10
  • Now that both the current and previous template versions (13.0 and 9.5) support all TFMs (net8.0, net9.0, net10.0) the split AspireVersionNetX options have all been removed. This drastically simplifies the template options logic but in the future when we have multiple Aspire versions that support different sets of TFMs we'll need to revisit this.

Fixes #11572
Fixes #11962

Checklist

image image image image

@DamianEdwards DamianEdwards requested review from Copilot, danegsta and davidfowl and removed request for Copilot October 22, 2025 00:18
@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12267

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12267"

@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 00:43
Copy link
Contributor

@Copilot 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 Aspire templates for .NET 10 with several key changes:

  • Changes default target framework from net9.0 to net10.0 across all templates
  • Introduces *.dev.localhost URLs as the default for AppHost projects on .NET 10
  • Configures single-file AppHost template to be hidden from Visual Studio
  • Modifies dashboard URL prioritization logic to favor *.localhost URLs in the summary view

Reviewed Changes

Copilot reviewed 78 out of 78 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
template.json files Updated default framework from net9.0 to net10.0 across all template types
launchSettings.json files Added conditional LocalhostTld configuration for dev.localhost URLs in AppHost and Web projects
template.json configuration files Added LocalhostTld parameter definition with CLI and IDE host configurations
Localization files Added English LocalhostTld strings to all language-specific templatestrings files (not localized)
ide.host.json (single-file) Added configuration to hide single-file AppHost template from Visual Studio
dotnetcli.host.json (single-file) Created host configuration for CLI parameter mappings
ApplicationOrchestrator.cs Modified URL ordering logic to prioritize *.localhost URLs in dashboard summary

@DamianEdwards DamianEdwards changed the title Damianedwards/dev localhost net10 templates Update the templates for .NET 10 Oct 22, 2025
@DamianEdwards
Copy link
Member Author

Kicked off mirroring of new versions of OTel packages.

};

// If the additional URL is a *.localhost address we want to highlight that URL in the dashboard
if (additionalUrl is not null && EndpointHostHelpers.IsLocalhostTld(additionalUrl.Endpoint?.EndpointAnnotation.TargetHost))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are surprising in this PR. Are these intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is to optimize what's shown in the dashboard for resources using *.localhost URLs, which includes the Blazor app in the Aspire starter template. Without this change, you get four URLs shown on the resources summary page, and the https://localhost:1234 URL is the first one shown, which is not optimal. This changes it so that the summary page only shows the *.localhost URLs if they're used, and moves the localhost URLs to the details pane.

@DamianEdwards DamianEdwards requested a review from radical October 22, 2025 22:18
@DamianEdwards DamianEdwards enabled auto-merge (squash) October 22, 2025 22:40
@davidfowl
Copy link
Member

Why is my API service localhost?

image

@DamianEdwards
Copy link
Member Author

@davidfowl this aligns with what the ASP.NET Core 10 templates do, i.e. only use the *.dev.localhost domain for apps primarily consumed from a browser, due to how *.localhost host names are resolved (browsers shortcut resolve it to the loopback addresses, but outside the browser it's dependent on the system DNS).

However, we can take a different approach here. I'm going to update this PR to instead have the URLs for resources use the *.dev.localhost host name for their primary URL displayed in the dashboard, if the apphost itself is configured to use one (via its launch profile). This has the advantage of working for all resources, not just ASP.NET Core projects too.

@radical
Copy link
Member

radical commented Oct 23, 2025

do we need any changes to tests? Do we need to also check the TFM on the created projects (not in this PR)?

@DamianEdwards
Copy link
Member Author

@radical

do we need any changes to tests? Do we need to also check the TFM on the created projects (not in this PR)?

Same combinations apply and are covered. Tests found a bunch of stuff while I was making this so they're doing their job. We could add a new case which is the --localhost-tld option.

@radical
Copy link
Member

radical commented Oct 23, 2025

/azp run aspire-tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical
Copy link
Member

radical commented Oct 23, 2025

Template tests pass on AzDO.

@radical
Copy link
Member

radical commented Oct 23, 2025

/ba-g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants