Repository navigation
Add VS Code resource debugging for .NET and Go - #18602
Ella Hathaway (ellahathaway) merged 127 commits into
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18602Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18602" |
There was a problem hiding this comment.
Pull request overview
This PR adds the first VS Code extension lane for #18538: a right-click Attach debugger action on running .NET project resources in the Aspire panel. It builds a CoreCLR attach debug configuration that targets the project's process by processName (best-effort resolving <AssemblyName> from the project file), rather than executable.pid, because DCP reports the dotnet run launcher PID rather than the child app process. The action is gated on a running top-level Project resource with a dotnet executable and a .csproj/.fsproj/.vbproj path, and only when the C# extension is installed; it re-resolves the latest resource before attaching so stale/ambiguous/missing resources fail closed with a warning.
Bundled alongside the feature is a broad telemetry overhaul: every event is renamed to its final wire name (aspire/vscode/... and aspire/dashboard/...) and routed through sendDangerousTelemetryEvent/sendDangerousTelemetryErrorEvent to bypass VS Code's automatic <extensionId>/ prefix, with manual opt-in gating (telemetryLevel), manual common properties, and explicit value sanitization.
Changes:
- Add
aspire-vscode.attachDebuggerToResourcecommand, menu contribution (canAttachDebuggercontext value), attachability helpers, and the attach execution flow with latest-resource re-resolution. - Rename all telemetry events to final wire names and route them through the "dangerous" send path with explicit gating/sanitization and manually-added common properties.
- Add localized strings and extensive unit tests for both the attach flow and the telemetry changes.
Show a summary per file
| File | Description |
|---|---|
extension/src/views/AspireAppHostTreeProvider.ts |
Core attach logic: attachability helpers, process-name derivation, attachDebuggerToResource, latest-resource resolution; propagates appHostPath through tree items. |
extension/src/extension.ts |
Registers the new attach command; renames the extension/activated telemetry event. |
extension/package.json |
Contributes the command, hidden palette entry, and view/item/context menu item; reorders action groups. |
extension/package.nls.json / extension/src/loc/strings.ts / extension/loc/xlf/aspire-vscode.xlf |
Adds/regenerates localized strings for the attach action. |
extension/src/utils/telemetry.ts |
Switches to dangerous-send path, adds manual gating, common properties, and value sanitization; hard-codes telemetry client version. |
extension/src/utils/telemetryRegistry.ts |
Renames event schema keys to final aspire/vscode/... and aspire/dashboard/... wire names; documents the convention. |
extension/telemetry.json |
Updates classification inventory keys to the new wire names. |
extension/src/dcp/DashboardTelemetryPassthrough.ts / AspireDcpServer.ts / AspireDebugSession.ts / AppHostLaunchService.ts / AppHostsViewTelemetry.ts / meaningfulEngagement.ts / appHostDiscovery.ts / workspace.ts / interactionService.ts |
Update event-name call sites and passthrough comments to the new namespaces. |
extension/src/test/*.test.ts, extension/src/test-e2e/packageSurface.e2e.test.ts |
Extensive tests for the attach flow, telemetry gating/sanitization/naming, and the manifest/surface contributions. |
Review details
- Files reviewed: 29/29 changed files
- Comments generated: 3
- Review effort level: Medium
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
I tried to place these as inline tracking comments, but GitHub rejected new inline comments because there is already a pending review draft for this user on the PR. I kept the tracking here instead while the branch was fixed:
These were fixed before the later Windows punctuation redaction follow-up. This is a top-level tracking comment, so there is no review thread to resolve; final tracking is in #18602 (comment). |
|
Pushed Validation on the live head passed locally: Remaining non-agent gates: live CoreCLR attach/manual readiness pass, plus telemetry/reviewer sign-off for the |
Ella Hathaway (ellahathaway)
left a comment
There was a problem hiding this comment.
Approved from my side.
Thanks for the helpful feedback, Sébastien Ros (@sebastienros)! I'd appreciate you taking another look at the DCP/Go launch fixes before we merge.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedThe PR changes 104 files. The tested surfaces include:
Change Categories
Test Scenarios ExecutedScenario 1: PR CLI artifact versionObjective: Verify the downloaded CLI artifact belongs to this PR head. Steps: Installed PR #18602's CLI and package hive in the repo container, then invoked the installed binary directly with Evidence: Scenario 2: Go launch-debugging and resource snapshot testsObjective: Validate the Go-specific launch configuration and snapshot metadata. Steps and results:
Evidence: Scenario 3: CLI AppHost resolution and describe testsObjective: Validate AppHost connection resolution and emitted debug metadata. Steps and results:
Evidence: Scenario 4: Packaged VSIX debugger attachment and safe failuresObjective: Exercise real .NET and Go debugger attachment, breakpoint handling, detach, continued resource responsiveness, and the negative resource-debug path. The repo container did not include Node/Corepack or Go, so the packaged VSIX E2E could not be run locally without installing an additional toolchain. The PR's own E2E workflow ran the Linux positive shard and Windows positive and negative shards successfully: Scenario 5: Test-routing and workflow coverageObjective: Validate the Go test-selection map and extension E2E workflow wiring. The matching PR CI jobs passed: Infrastructure.Tests and extension unit tests. The local filtered Infrastructure.Tests run had 150 passes and one environment-only failure: Evidence: CI Infrastructure ValidationGitHub Actions:
Azure DevOps: n/a — no Azure Pipelines files changed. Summary
Overall Result✅ PR VERIFIED — relevant PR CI checks passed, including packaged Linux/Windows debugger E2E and the negative shard. Local container limitations are documented above. Recommendations
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Ella Hathaway (@ellahathaway) have you pulled this and tested out locally the Go debugging experience? |
There was a problem hiding this comment.
🟡 Changes recommended
The Linux debugging instructions omit the ptrace restriction that can prevent Delve from attaching and need to document an administrator-approved configuration or recommend Start Debugging instead.
1 open issue
1 resolved since last review
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
I have, here's a demo: go_debugging_demo.mp4 |
|


Summary
Adds resource debugger attachment for running .NET and Go resources from the Aspire view and the
aspire_resource_debugCopilot tool.Fixes #18538.
Fixes #18937.
What changed
dotnet run,dotnet watch, orgo run. Process discovery supports Windows, macOS, and Linux.dotnet runrequires the direct application child, whiledotnet watchandgo runsupport verified descendants.alreadyDebugging.project.launchCommand,project.configuration, andproject.targetFrameworksnapshot metadata. Current snapshots use exactTargetPathidentity; theTargetNamecompatibility fallback is limited to older snapshots that do not contain the new metadata.aspire_resource_debugwith input validation, explicit confirmation, invocation-time re-resolution, linked cancellation, and bounded output.Evidence
Real process-tree validation covers:
dotnet run: the application is a direct child.dotnet watch: the application is a transitive descendant.go run: the application is a descendant.The packaged Linux VSIX E2E shard installs pinned C# and Go debugger extensions plus Delve. It invokes the registered resource-debug tool for both languages, binds a source breakpoint, observes the matching stack frame, detaches, verifies the resource still responds, and tears down the AppHost.
Validation
Checklist
The language-model boundary intentionally excludes process IDs, absolute paths, arguments, environment values, and raw failures. Debug attachment also requires VS Code confirmation before invocation.