-
Notifications
You must be signed in to change notification settings - Fork 703
Update the templates for .NET 10 #12267
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
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12267 Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12267" |
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 updates Aspire templates for .NET 10 with several key changes:
- Changes default target framework from
net9.0
tonet10.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 |
src/Aspire.ProjectTemplates/templates/aspire-apphost-singlefile/.template.config/template.json
Outdated
Show resolved
Hide resolved
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)) |
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.
These changes are surprising in this PR. Are these intentional?
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.
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.
@davidfowl this aligns with what the ASP.NET Core 10 templates do, i.e. only use the However, we can take a different approach here. I'm going to update this PR to instead have the URLs for resources use the |
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 |
/azp run aspire-tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Template tests pass on AzDO. |
/ba-g |
Description
Updates the Aspire templates for .NET 10:
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.*.dev.localhost
URL by default, e.g.mygreataspireapp_apphost.dev.localhost
dotnet new
experienceApplicationOrchestrator
so that resource URLs for*.localhost
are given priority in the dashboard, showing in the resource summary page and hiding the plainlocalhost
URL from the summary. Both URLs show in the resource details pane.net8.0
,net9.0
,net10.0
) the splitAspireVersionNetX
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