Skip to content

Implement workaround for Aspire dashboard launching#46100

Merged
marcpopMSFT merged 5 commits intodotnet:release/9.0.2xxfrom
tmat:AspireBrowserLaunch
Jan 21, 2025
Merged

Implement workaround for Aspire dashboard launching#46100
marcpopMSFT merged 5 commits intodotnet:release/9.0.2xxfrom
tmat:AspireBrowserLaunch

Conversation

@tmat
Copy link
Copy Markdown
Member

@tmat tmat commented Jan 17, 2025

Workaround for #44262.

Context

The change fixes browser launching for Aspire projects in dotnet watch. Aspire application is expected to launch browser on dashboard URL that contains auth token, but the standard dotnet-watch browser launching implementation launches browser without the token.

Customer impact

Aspire application run via dotnet-watch doesn't open dashboard page in the browser.

Details

The fix implements a simple workaround: it scans the output of the app host for the full dashboard URL.
The proper fix would be to add DCP protocol request that instructs IDE to launch browser at specified URL. This approach would avoid adding Aspire specific logic to launch profile processing. See microsoft/aspire#7197.

We should also
a) Move VS implementation of profile processing to a shared library/source package in SDK, so that we can share the logic between VS, VS Code and dotnet-run
b) Implement browser launching in dotnet run (#9038) and use [a] to process launch profile

Changes made

Special cases Aspire project in existing URL scanning code.

Testing

Manual testing to confirm that the changes correctly open the dashboard in the browser.

Risks

Small potential risk of breaking URL scanning, although this has been mitigated by added tests.

@tmat tmat requested a review from a team as a code owner January 17, 2025 20:28
@ghost ghost added Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK untriaged Request triage from a team member labels Jan 17, 2025
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Thanks for your PR, @tmat.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@davidfowl
Copy link
Copy Markdown
Member

We want this in 9.0.2xx for aspire @marcpopMSFT, just a heads up.

@tmat tmat force-pushed the AspireBrowserLaunch branch from 7a3e8b1 to 8a8df71 Compare January 21, 2025 19:39
@marcpopMSFT
Copy link
Copy Markdown
Member

merge commit was a comment and built passed. Merging.

@tmat tmat modified the milestones: 9.0.2, 9.0.2xx Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK Servicing-approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants