microsoft / microsoft/aspire

[VS Code] Attach a debugger to resources in a running AppHost

Open
#18,538 2 comments 1 reaction 1 assignee Claimed by @ellahathaway View on GitHub
area-vscode
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

When you start Aspire with `aspire start`, attaching a debugger after the fact is a bit annoying. It's easier to just stop the AppHost and restart with debugging.

### Describe the solution you'd like

I would like the Aspire extension to have something like right click | Attach Debugger, removing the need for launch configurations. Or if that's not possible, I would like a button I can press to generate the launch configurations for an apphost.

### Additional context

For .NET project resources, the current workaround is to create a `launch.json` with some configuration like this:

``` json
{
"configurations": [
{
"type": "coreclr",
"request": "attach",
"name": "Attach to Some Thing",
"processName": "Some.Thing"
}
]
}
```

This is for attaching a debugger to a .NET project resource. The exact configuration varies depending on the type of thing. I don't have an example for attaching a debugger to a JavaScript or Python app, but I'm sure it's possible. It's also annoying having to create these launch configurations by hand.

## Completion criteria

- Eligible running resources expose an **Attach debugger** action from the Aspire pane.
- The action uses Aspire resource debug metadata and a stable launched-process identity rather than guessing from a project filename.
- .NET attachment consumes the child PID or evaluated process identity tracked by #18937.
- Supported non-.NET resources use the same debugger routing and user overrides as normal Aspire debug launches.
- Missing debugger extensions use the install or enable guidance tracked by #17845.
- Attaching does not restart the AppHost or resource.
- Detaching does not stop a process that the extension did not launch; explicit resource or AppHost stop actions retain their existing ownership behavior.
- End-to-end coverage includes at least one .NET resource and one non-.NET resource, including attach, breakpoint binding, detach, and teardown.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.