Improve AppHost backchannel connection error message#18051
Open
mehara-rothila wants to merge 2 commits into
Open
Improve AppHost backchannel connection error message#18051mehara-rothila wants to merge 2 commits into
mehara-rothila wants to merge 2 commits into
Conversation
When the AppHost process exits before the CLI can establish a backchannel
connection, the error message was vague: it omitted the exit code, repeated
itself ("possibly crashed" and "exited unexpectedly" mean the same thing),
and could end with a trailing period from both the format string and the
inner message.
Include the exit code in the message and drop the redundant "possibly
crashed before it was available" phrasing so the error clearly states what
happened. This is fixed in both the local (DotNetCliRunner) and server
(GuestAppHostProject) backchannel paths.
Before: An error occurred while connecting to the AppHost. The AppHost possibly crashed before it was available: AppHost process has exited unexpectedly
After: An error occurred while connecting to the AppHost: The AppHost process exited unexpectedly with exit code 42.
Fixes microsoft#17277
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18051Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18051" |
Author
|
@microsoft-github-policy-service agree |
1 task
ellahathaway
reviewed
Jun 9, 2026
| </data> | ||
| <data name="ErrorConnectingToAppHost" xml:space="preserve"> | ||
| <value>An error occurred while connecting to the AppHost. The AppHost possibly crashed before it was available: {0}</value> | ||
| <value>An error occurred while connecting to the AppHost: {0}.</value> |
Contributor
There was a problem hiding this comment.
Suggested change
| <value>An error occurred while connecting to the AppHost: {0}.</value> | |
| <value>An error occurred while connecting to the AppHost: {0}</value> |
See #17288 - strings with interpolated content shouldn't end with a period.
| var message = execution.ExitCode == CliExitCodes.Success | ||
| ? "AppHost process has exited" | ||
| : "AppHost process has exited unexpectedly"; | ||
| ? $"The AppHost process exited with exit code {execution.ExitCode}" |
Contributor
There was a problem hiding this comment.
I don't think we need the exit code when the apphost process exited successfully.
| var message = process.ExitCode == CliExitCodes.Success | ||
| ? "AppHost server process has exited" | ||
| : "AppHost server process has exited unexpectedly"; | ||
| ? $"The AppHost server process exited with exit code {process.ExitCode}" |
Contributor
There was a problem hiding this comment.
- Drop the trailing period from the ErrorConnectingToAppHost string (interpolated strings shouldn't end with a period) - Omit the exit code when the AppHost exited successfully, in both the local (DotNetCliRunner) and server (GuestAppHostProject) paths - Re-sync the 13 .xlf source strings
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.
Fixes #17277
When the AppHost exits before the CLI can establish a backchannel connection, the error omitted the exit code and used redundant wording (
possibly crashedandexited unexpectedlysay the same thing). This PR includes the exit code and drops the redundant phrasing, in both the local (DotNetCliRunner) and server (GuestAppHostProject) backchannel paths.Before:
After:
The
ErrorConnectingToAppHostresource string and its 13.xlffiles are updated (sources synced, targets flaggedneeds-review-translation). Built locally against .NET 10.0.201 — compiles clean and xliff is in sync.