Skip to content

CLI error message when AppHost exits before backchannel connection is vague and missing exit code #17277

@ellahathaway

Description

@ellahathaway

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When the AppHost process exits before the CLI can establish a backchannel connection, the error message is:

An error occurred while connecting to the AppHost. The AppHost possibly crashed before it was available: AppHost process has exited unexpectedly..

Problems:

  1. No exit code — the user has no idea why the process failed
  2. Redundant phrasing — possibly crashed + exited unexpectedly say the same thing
  3. Double period at the end — the inner message ends with . and the format string also appends .

Expected Behavior

The error should include the exit code and clearly describe what happened:

An error occurred while connecting to the AppHost: The AppHost process exited unexpectedly with exit code 42.

Steps To Reproduce

  1. Have an AppHost project that crashes on startup (e.g., build error, missing dependency)
  2. Run aspire run
  3. Observe the vague error message

Anything else?

This affects both DotNetCliRunner (local) and GuestAppHostProject (remote/server) paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownerstriage:bot-seenAspire triage bot has seen this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions