Repository navigation
Fail promptly when dotnet run launches an AppHost in publish mode - #21065
Damian Edwards (DamianEdwards) merged 2 commits into
Conversation
Reject dashboard readiness requests in publish mode with guidance to use aspire publish. Cover effective operation configuration and disabled dashboards. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bd0dfb5d-566e-4711-8011-8ca4a20398d8
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21065Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21065" |
Move user-facing guidance into Hosting message resources and update generated localization inputs and regression assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bd0dfb5d-566e-4711-8011-8ca4a20398d8
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped guard has focused regression coverage and reported scenario validation, with no unresolved blocking issues.
0 open findings
What changed in this PR
Fixes #18946 by rejecting dashboard-readiness requests when an AppHost is in publish mode, preventing dotnet run --operation publish from hanging.
Changes:
- Adds an effective-mode guard with guidance to use
aspire publish. - Covers publish-mode variants and dashboard-disabled behavior with regression tests.
- Adds localization entries and contributor guidance.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Tests/Backchannel/AppHostRpcTargetTests.cs | Adds regression coverage. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.zh-Hant.xlf | Adds Traditional Chinese localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.zh-Hans.xlf | Adds Simplified Chinese localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.tr.xlf | Adds Turkish localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.ru.xlf | Adds Russian localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.pt-BR.xlf | Adds Brazilian Portuguese localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.pl.xlf | Adds Polish localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.ko.xlf | Adds Korean localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.ja.xlf | Adds Japanese localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.it.xlf | Adds Italian localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.fr.xlf | Adds French localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.es.xlf | Adds Spanish localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.de.xlf | Adds German localization placeholder. |
| src/Aspire.Hosting/Resources/xlf/MessageStrings.cs.xlf | Adds Czech localization placeholder. |
| src/Aspire.Hosting/Resources/MessageStrings.resx | Defines the actionable error message. |
| src/Aspire.Hosting/Resources/MessageStrings.Designer.cs | Exposes the message resource accessor. |
| src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs | Rejects dashboard readiness in publish mode. |
| docs/contributing.md | Directs publishing users to aspire publish. |
Files not reviewed (1)
- src/Aspire.Hosting/Resources/MessageStrings.Designer.cs: Generated file
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Tests selector53 / 99 PR test projects · 4 PR jobs, from 17 changed files. Selected PR test projects (53 / 99)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 show 46
🧪 📦 affected project 📦 affected project 🔧 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
7f11155
into
main
…ublish Documents microsoft/aspire#21065: dotnet run --operation publish now fails fast with a clear error instead of hanging at dashboard startup when the CLI run hook is enabled. Adds a troubleshooting entry and a cross-reference note in the Aspire SDK docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pull request created: #1902
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1902 targeting Triggered signals: Note This draft PR needs human review before merging. |
Description
dotnet run --operation publishdelegates toaspire runwhen the CLI run hook is enabled, but starts the AppHost in publish mode. The CLI waits for dashboard readiness while publishing never starts the dashboard and expects a publishing client to consume progress and request shutdown. This leaves the command stuck atStarting dashboard....Reject the dashboard-readiness RPC when the AppHost's effective execution mode is publish, returning guidance to use
aspire publish. Checking the effective mode also covers legacy--publisher manifestand configuration-based invocation. The check runs before the dashboard-disabled shortcut so disabling the dashboard cannot hide the mismatch. Normal publishing does not call this RPC and remains unchanged.Adds regression coverage and contributor guidance.
User-facing usage
Now exits with code 2 and reports:
Validation
dotnet test --project .\tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-class "Aspire.Hosting.Backchannel.AppHostRpcTargetTests" --filter-class "Aspire.Hosting.Backchannel.AppHostBackchannelTests" --filter-class "Aspire.Hosting.Tests.OperationModesTests" --filter-class "Aspire.Hosting.Tests.Publishing.PipelineExecutorTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"- passed, 24 tests. The six new publish-mode cases failed before the fix. Existing NU1902/NU1903 package audit warnings were reported.dotnet build .\playground\Redis\Redis.AppHost\Redis.AppHost.csproj -v:q /p:SkipNativeBuild=true- passed.dotnet run --project .\playground\Redis\Redis.AppHost\ -p:_AspireTasksAssembly="$PWD\artifacts\bin\Aspire.Hosting.Tasks\Debug\net10.0\Aspire.Hosting.Tasks.dll" --operation publish- reproduced the hang before the fix; after the fix, exited with code 2 and the guidance above. The task-assembly override is needed for this source-build workspace.aspire do publish-manifest --project .\playground\Redis\Redis.AppHost\Redis.AppHost.csproj --no-build --output-path <scratch> --non-interactive- passed with CLI 13.6.1 against the fixed AppHost; generated the manifest and all four pipeline steps succeeded._AspireTasksAssemblywas set to the source-built task assembly.Fixes #18946
Checklist
<remarks />and<code />elements on your triple slash comments?