Skip to content

Add IdeSession-based browser debugging for Blazor WASM#17559

Draft
javiercn wants to merge 1 commit into
microsoft:mainfrom
javiercn:javiercn/ide-debugger-protocol
Draft

Add IdeSession-based browser debugging for Blazor WASM#17559
javiercn wants to merge 1 commit into
microsoft:mainfrom
javiercn:javiercn/ide-debugger-protocol

Conversation

@javiercn
Copy link
Copy Markdown
Contributor

Summary

Adds a Debug in Browser command for Blazor WebAssembly projects (both standalone gateway and hosted models). When clicked, Aspire signals DCP to start an IDE debug session via the IDE execution protocol.

Key changes:

  • BrowserDebugAnnotation — marks resources serving debuggable WASM clients
  • IdeSession DCP resource — new custom resource with state machine (Initial → Running → Stopped/Failed)
  • BrowserDebugLaunchConfiguration — carries \project_path\ and \�pp_url\ for the IDE
  • ExecutableCreator — creates IdeSession in DCP at startup (Initial state), degrades gracefully if DCP doesn't support it yet
  • Command handler — patches IdeSession \desired_state\ to Running via ApplicationOrchestrator → DcpExecutor

Depends on:


This is a prototype/spike — not ready for review.

Implement 'Debug in Browser' command for Blazor WebAssembly apps using
the DCP IdeSession resource model (microsoft/dcp#169):

- BrowserDebugAnnotation: marks resources as browser-debuggable
- IdeSession DCP resource: models debug sessions with lifecycle states
- BrowserDebugLaunchConfiguration: launch config for browser-debug type
- IDcpExecutor/DcpExecutor: CreateIdeSessionAsync + StartIdeSessionAsync
- ExecutableCreator: creates IdeSession at startup, handles 404 gracefully
  when DCP does not yet support IdeSession
- ApplicationOrchestrator: LaunchBrowserDebugSessionAsync coordinator
- BlazorGatewayExtensions: annotation + command for standalone WASM
- BlazorHostedExtensions: auto-registers debug command in EnsureEnvironmentCallback
  (triggered by ProxyBlazorService/ProxyBlazorTelemetry)
- Command visibility gated on IDE connection (DEBUG_SESSION_PORT)
- Suppress CS0436 in Aspire.Hosting.Blazor (pre-existing StringComparers conflict)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17559

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17559"

@github-actions
Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant