Clean up legacy CLI configuration file support (settings.json, apphost.run.json, globalsettings.json)
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
## Summary
PR #14985 introduced `aspire.config.json` as the consolidated CLI configuration file, replacing the previous split across `.aspire/settings.json`, `apphost.run.json`, and `globalsettings.json`. During the transition, the code includes fallback logic to read and migrate these legacy files.
This issue tracks the eventual removal of all legacy configuration support once we are confident that most users have migrated to `aspire.config.json`.
## What needs to be cleaned up
### Legacy file fallbacks
- **`AspireConfigFile.LoadOrCreate`** — falls back to `.aspire/settings.json` + `apphost.run.json` when `aspire.config.json` doesn't exist
- **`ConfigurationService.FindNearestSettingsFile`** — walks up directories checking for `.aspire/settings.json` as a fallback
- **`ConfigurationHelper.RegisterSettingsFiles`** — registers `.aspire/settings.json` as a fallback JSON config provider
- **`ProjectLocator.GetAppHostProjectFileFromSettingsAsync`** — reads `.aspire/settings.json` as a fallback for AppHost path
- **`AddCommand`** — reads channel from `AspireJsonConfiguration.Load()` as a fallback
- **`LanguageService.GetConfiguredProjectAsync`** — reads flat `"language"` key as fallback for `"appHost.language"`
### Legacy file migration
- **`Program.GetGlobalSettingsPath`** — copies `globalsettings.json` → `aspire.config.json` (intentionally keeps old file for older CLI compatibility)
- **`ProjectLocator.MigrateLegacySettings`** — migrates `.aspire/settings.json` to `aspire.config.json`
- **`AspireConfigFile.ReadApphostRunProfiles`** — reads legacy `apphost.run.json` launch profiles
### Legacy types
- **`AspireJsonConfiguration`** — the entire legacy settings model can potentially be removed or reduced to a minimal migration helper
## Notes
- The old files are **intentionally kept on disk** during migration so that older CLI versions continue to work. This is a deliberate transitional strategy.
- This cleanup may be deferred for a few releases (possibly beyond 13.3) to ensure enough time has passed for users to migrate.
- All fallback locations in the codebase are marked with `// TODO:` comments linking to this issue.
## Related
- Implements: #14741
- PR: #14985
/cc @mitchdenny @davidfowl
Contributor guide
Assessment
This issue has not been assessed yet.