`aspire ps` hangs if app host has no url or on breakpoint
Nobody has claimed this yet.
- 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)
### 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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