microsoft / microsoft/aspire

`aspire ps` hangs if app host has no url or on breakpoint

Open
#15,576 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-cli
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 12h
Merged PRs (30d)
201

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

If you have an app host that's broken on a breakpoint, the `aspire ps` command gets stuck on `Scanning for running apphosts...`. (At least it got stuck for over a minute before I got bored and gave up)

Image

### Expected Behavior

`aspire ps` shouldn't hang indefinitely.

### Steps To Reproduce

1. Use the below code
2. Set a breakpoint on the last line
3. Start the app host with debugger
4. Once your breakpoint is hit, run `aspire ps`
```
#:package Aspire.Hosting.Azure.CosmosDB@13.3.0-pr.15503.g3532eede
#:sdk Aspire.AppHost.Sdk@13.3.0-pr.15503.g3532eede

#pragma warning disable ASPIRECOSMOSDB001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

var builder = DistributedApplication.CreateBuilder(args);

builder.AddAzureCosmosDB("cosmos")
.RunAsPreviewEmulator(x => x.WithDataExplorer());

using var app = builder.Build();

await app.StartAsync();

// SET BREAKPOINT HERE
await Task.Delay(Timeout.Infinite);
```

### Exceptions (if any)

_No response_

### .NET Version info

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided app-host code, a breakpoint on the final line, and the `aspire ps` command. Trace the `Scanning for running apphosts...` path and verify that `aspire ps` completes with a useful result instead of hanging indefinitely when the app host has no URL or is paused at a breakpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.