Fix migration from .aspire/settings.json to aspire.config.json#15524
Merged
mitchdenny merged 2 commits intomainfrom Mar 24, 2026
Merged
Fix migration from .aspire/settings.json to aspire.config.json#15524mitchdenny merged 2 commits intomainfrom
mitchdenny merged 2 commits intomainfrom
Conversation
When the AppHost was found from legacy .aspire/settings.json, the UseOrFindAppHostProjectFileAsync method returned early without calling CreateSettingsFileAsync, so the migration to aspire.config.json never triggered. This fix ensures CreateSettingsFileAsync is called when createSettingsFile is true and the AppHost is found from settings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15524Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15524" |
JamesNK
approved these changes
Mar 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes migration from legacy .aspire/settings.json to aspire.config.json during AppHost discovery, ensuring the migration runs even when the AppHost is found via legacy settings (not only via directory scanning).
Changes:
- Update
ProjectLocator.UseOrFindAppHostProjectFileAsyncto callCreateSettingsFileAsyncwhen the AppHost is resolved from settings andcreateSettingsFileistrue. - Add a regression test intended to verify migration occurs when the AppHost is discovered from legacy
.aspire/settings.json.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Aspire.Cli/Projects/ProjectLocator.cs |
Ensures settings/migration logic runs when the AppHost is found via settings-derived paths. |
tests/Aspire.Cli.Tests/Projects/ProjectLocatorTests.cs |
Adds a regression test for legacy-settings-driven migration behavior. |
Address Copilot review feedback: compute appHostPath relative to .aspire/ directory (not workspace root), normalize to forward slashes, and add a decoy project to ensure the legacy-settings resolution path is actually exercised rather than falling through to directory scanning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🎬 CLI E2E Test Recordings — 49 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23485742793 |
Member
Author
|
/backport to release/13.2 |
Contributor
|
Started backporting to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix migration from
.aspire/settings.jsontoaspire.config.jsonwhen upgrading from Aspire 13.1 (or lower) to 13.2.Problem: In
ProjectLocator.UseOrFindAppHostProjectFileAsync(), when the AppHost was found from the legacy.aspire/settings.json, the method returned early without callingCreateSettingsFileAsync. ThecreateSettingsFilecheck was only reachable via the directory-scanning fallback path, so a working.aspire/settings.jsonparadoxically prevented its own migration toaspire.config.json.Fix: Call
CreateSettingsFileAsyncwhencreateSettingsFileis true and the AppHost is found from settings, ensuring the legacy config is migrated.Validation: All 1681 CLI tests pass, including a new regression test that verifies the migration occurs when the AppHost is discovered from legacy settings.
Checklist