Fix aspire run failing when DisableDashboard is true#16773
Conversation
When DisableDashboard = true, aspire run would exit with a DashboardFailure error while aspire start succeeded. Two changes: 1. AppHostRpcTarget: Return DashboardUrlsState with DashboardHealthy=false instead of throwing InvalidOperationException when the dashboard is disabled. 2. RunCommand: Treat an unhealthy dashboard as a warning instead of a fatal error, allowing the app host to continue running without the dashboard. Fixes #16619
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16773Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16773" |
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency where aspire run failed when an AppHost disables the dashboard (DisableDashboard = true), while aspire start succeeded. It adjusts both the AppHost backchannel behavior and the CLI’s handling so running without a dashboard is treated as a supported configuration.
Changes:
- AppHost backchannel now returns an unhealthy
DashboardUrlsState(instead of throwing) when the dashboard is disabled. aspire runno longer treats an unhealthy dashboard as fatal; it emits a warning and continues, showing “N/A” for the dashboard URL.- Updated CLI string resources and adjusted the related unit test to expect success.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs | Updates test to validate run succeeds when the dashboard is unhealthy/disabled. |
| src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs | Returns DashboardUrlsState with DashboardHealthy=false instead of throwing when dashboard is disabled. |
| src/Aspire.Cli/Commands/RunCommand.cs | Downgrades unhealthy dashboard from fatal error/exit code to a warning and continues. |
| src/Aspire.Cli/Resources/RunCommandStrings.resx | Updates the user-facing message to include the “disabled” case. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.zh-Hant.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.zh-Hans.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.tr.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.ru.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.pt-BR.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.pl.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.ko.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.ja.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.it.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.fr.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.es.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.de.xlf | Updates localized source string; marks translation for review. |
| src/Aspire.Cli/Resources/xlf/RunCommandStrings.cs.xlf | Updates localized source string; marks translation for review. |
…sert warning in test
|
🎬 CLI E2E Test Recordings — 77 recordings uploaded (commit View all recordings
📹 Recordings uploaded automatically from CI run #25421239338 |
|
No documentation PR is required for this change. This PR is a bug fix that corrects an inconsistency where
|
|
@adamint we should verify this in the extension. |

Description
When
DisableDashboard = trueis set in an app host,aspire runwould fail with aDashboardFailureexit code whileaspire startsucceeded. This PR fixes the inconsistency so both commands work when the dashboard is disabled.Two changes:
src/Aspire.Hosting): ReturnDashboardUrlsStatewithDashboardHealthy = falseinstead of throwingInvalidOperationExceptionwhen the dashboard is disabled. Also downgraded the log level fromErrortoDebugsince this is an expected configuration.src/Aspire.Cli): Treat an unhealthy dashboard as a warning instead of a fatal error, allowing the app host to continue running without the dashboard. The dashboard URL shows as "N/A" in the summary output.Fixes #16619
Checklist