Skip to content

[release/13.2] Fix TS AppHost restore config resolution#15625

Open
sebastienros wants to merge 1 commit intorelease/13.2from
sebros/fix-ts-apphost-restore
Open

[release/13.2] Fix TS AppHost restore config resolution#15625
sebastienros wants to merge 1 commit intorelease/13.2from
sebros/fix-ts-apphost-restore

Conversation

@sebastienros
Copy link
Contributor

Description

aspire new for TypeScript AppHost projects was already triggering restore, but some of the first-run restore/code generation paths still read legacy .aspire/settings.json instead of the aspire.config.json that new templates produce. As a result, project-local channel and package resolution settings could be missed until a later aspire restore or aspire run.

This change updates the TypeScript starter and guest AppHost server preparation paths to prefer aspire.config.json with legacy fallback preserved. It also persists the template SDK version before the automatic restore/code generation step so the initial generated project resolves integrations against the same version it was created with.

The test updates cover the new-format config path in the starter flow and in both generated and prebuilt AppHost server channel resolution behavior.

Fixes #15413

Validation:

  • ./dotnet.sh test tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj -- --filter-method "*.NewCommandWithTypeScriptStarterGeneratesSdkArtifacts" --filter-method "*.CreateProjectFiles_NuGetConfig_UsesProjectLocalChannel_NotGlobalChannel_MatchesSnapshot" --filter-method "*.ResolveChannelNameAsync_UsesProjectLocalAspireConfig_NotGlobalChannel" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • ./dotnet.sh test tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj -- --filter-class "*.NewCommandTests" --filter-class "*.AppHostServerProjectTests" --filter-class "*.PrebuiltAppHostServerTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 16:42
Copy link
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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions
Copy link
Contributor

🚀 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15625

Or

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

@sebastienros sebastienros changed the base branch from main to release/13.2 March 26, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aspire restore should be auto-run for TS apphost apps after aspire new

2 participants