Skip to content

[docs] Note *.dev.localhost support for polyglot AppHosts in aspire new docs - #1120

Closed
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.4from
docs/aspire-17639-dev-localhost-polyglot-e5b08b9b7c6b31f4
Closed

aspire-repo-bot[bot] wants to merge 1 commit into
release/13.4from
docs/aspire-17639-dev-localhost-polyglot-e5b08b9b7c6b31f4

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#17639 — @danegsta

Targeting release/13.4 — the latest release branch on microsoft/aspire.dev — because release/13.5 (from the source PR milestone 13.5) does not exist there.

Why this PR is needed

PR microsoft/aspire#17639 fixed a bug where aspire run failed for polyglot AppHosts (for example, TypeScript AppHosts using the Express/React template) that were scaffolded with *.dev.localhost URLs. The error was:

ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL must contain a local loopback address

This happened because the resource service endpoint validation only checked Uri.IsLoopback, which does not recognize RFC 6761 *.localhost subdomains. The fix extends the check to accept *.localhost subdomains as local endpoints.

The existing aspire new docs described the *.dev.localhost option but did not document how it interacts with polyglot AppHosts, and did not mention the previous failure mode or the fix.

Summary of changes

Updated src/frontend/src/content/docs/reference/cli/commands/aspire-new.mdx to add a "Polyglot AppHosts and *.dev.localhost URLs" subsection under the "Yes — use *.dev.localhost URLs" heading. The new section:

  • Confirms that polyglot AppHosts (e.g. TypeScript) scaffolded with *.dev.localhost URLs work correctly with aspire run.
  • Explains that Aspire treats *.localhost subdomains as local per RFC 6761, routing through ListenLocalhost without opening new network listeners.
  • Includes a callout for users who previously saw the "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL must contain a local loopback address" error, directing them to update to Aspire 13.5+.

Files modified

  • src/frontend/src/content/docs/reference/cli/commands/aspire-new.mdx — updated (existing page)

Generated by PR Documentation Check for issue #17639 · ● 11.1M · ◷

Documents the fix from microsoft/aspire#17639 where aspire run now
correctly accepts *.localhost subdomains (per RFC 6761) as local
resource service endpoints, enabling polyglot AppHosts scaffolded
with *.dev.localhost URLs to run without error.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label May 29, 2026
@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review May 29, 2026 05:40
Copilot AI review requested due to automatic review settings May 29, 2026 05:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This docs-only PR updates the aspire new command reference to explain how *.dev.localhost URLs interact with polyglot AppHosts and the related loopback validation fix.

Changes:

  • Adds a subsection for polyglot AppHosts using *.dev.localhost URLs.
  • Documents the prior ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL loopback error and advises upgrading to Aspire 13.5+.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


#### Polyglot AppHosts and \*.dev.localhost URLs

When you scaffold a polyglot AppHost (for example, a TypeScript AppHost using the Express/React template) and choose **Yes**, the `ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL` in `aspire.config.json` is set to a `*.dev.localhost` subdomain (for example, `https://myappname.dev.localhost`). The Aspire runtime recognizes `*.localhost` subdomains as local endpoints — per [RFC 6761](https://www.rfc-editor.org/rfc/rfc6761) — and routes the resource service connection through `ListenLocalhost`, so no extra network access is opened.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants