[release/13.4] Remove duplicated profiles block from empty C# AppHost aspire.config.json#17820
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17820Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17820" |
…json
The embedded CLI template src/Aspire.Cli/Templating/Templates/empty-apphost/aspire.config.json
shipped a profiles block that duplicated apphost.run.json. The canonical template in
src/Aspire.ProjectTemplates/templates/aspire-apphost-singlefile/aspire.config.json
intentionally has no profiles (per Damian's design): aspire run / dotnet run apphost.cs
honor apphost.run.json when present, so aspire.config.json for the C# Empty template
should only carry { "appHost": { "path": "apphost.cs" } }.
Updated NewCommandTests to:
- assert that aspire.config.json has no profiles block and pins appHost.path = apphost.cs
- assert that apphost.run.json carries the launch URLs (plain localhost and dev.localhost variants)
- drop the now-unused AssertHttpsApplicationUrlMatches helper
Fixes #17660
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
29c7ec8 to
714fa58
Compare
|
Force-pushed the backport branch after rebasing onto current The previous CI failures (Kubernetes deploy tests + ChannelUpdateWorkflowTests) were caused by the branch being out of date: it was based on NuGet treats the prerelease After the rebase the diff is unchanged (32+/-43 in |
|
❓ CLI E2E Tests unknown — 110 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26799540403 |
|
IIRC, last time we looked at the run json file was because we had accidentally broken |
… AppHost The C# empty AppHost template (aspire new aspire-empty) in Aspire 13.4 was generating a duplicate profiles block in aspire.config.json that was also present in apphost.run.json. This regression is fixed in microsoft/aspire#17820: launch profiles now live exclusively in apphost.run.json and aspire.config.json is minimal (AppHost path only). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pull request created: #1192
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1192 targeting Updated Note This draft PR needs human review before merging. |
Backport of #17781 to release/13.4
/cc @mitchdenny
Customer Impact
Customers running
aspire new aspire-emptyfor a C# (.NET) project on 13.4 get anaspire.config.jsonwhoseprofilesblock duplicates the same content already inapphost.run.json. Reported externally as #17660 (regression vs 13.3.5, where onlyaspire.config.jsonwas emitted and contained the profiles). The duplication is confusing and gives the impression that the two files could drift; it isn't a runtime failure, but it ships visible noise in every newly-scaffolded empty C# project.Testing
NewCommandTestsupdated to assert the new shape (aspire.config.jsonminimal; profiles only inapphost.run.json); 77/77 pass locally.Cli.EndToEnd-EmptyAppHostTemplateTests.CreateAndRunEmptyAppHostProject(scaffold →aspire start→ curl dashboard for HTTP 200 →aspire stop) passes on the PR.--localhost-tldvariants (verified file shapes), thenaspire start→ dashboard bound at the port fromapphost.run.json→ HTTP 200 → cleanaspire stop.Risk
Very low. Content-only change to the embedded
empty-apphost/aspire.config.jsontemplate — no code paths altered.DotNetAppHostProjectalready readsapphost.run.jsonfirst and only falls back toaspire.config.json#profilesif the run.json is missing, so the removed block was dead for newly-scaffolded projects. Existing on-disk projects are not modified.Regression?
Yes. Works in 13.3.5; regressed in 13.4 when #16828 re-added
apphost.run.jsonalongsideaspire.config.json(deliberate defense-in-depth fordotnet run apphost.cscompatibility, but it left theprofilesblock duplicated across both files).