Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Blazor WASM debugging #44

Closed
boyedarat opened this issue Jul 14, 2023 · 4 comments
Closed

Support for Blazor WASM debugging #44

boyedarat opened this issue Jul 14, 2023 · 4 comments

Comments

@boyedarat
Copy link

@albertwoo FsBolero has support for WebAssembly debugging in VS using Chrome-devtools:
fsbolero/Bolero#294
fsbolero/Bolero#307

Would it be possible to do something similar with Fun.Blazor?

Thanks.

@albertwoo
Copy link
Contributor

I think it just works for Fun.Blazor wasm, you just need to add

"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"

into your launchSettings.json.
I also updated the templates: dotnet new install Fun.Blazor.Templates::3.0.3

@boyedarat
Copy link
Author

Can't get it to work on VS Code though:
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0] Executing endpoint 'Fallback /wasm' Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost/wasm - - info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0] Executing endpoint 'Fallback /wasm' Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executing endpoint 'Fallback /wasm' info: Microsoft.AspNetCore.Hosting.Diagnostics[1] Request starting HTTP/1.1 GET http://localhost/wasm - - Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executing endpoint 'Fallback /wasm' info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1] Executed endpoint 'Fallback /wasm' Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost/wasm - - info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0] Executing endpoint 'Fallback /wasm' Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint 'Fallback /wasm' info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1] Executed endpoint 'Fallback /wasm' info: Microsoft.AspNetCore.Hosting.Diagnostics[2] Request finished HTTP/1.1 GET http://localhost/wasm - - - 200 - text/html;+charset=UTF-8 16.2767ms The program '[11840] BlazorTest.Server.dll' has exited with code -1 (0xffffffff).

Here is the launch.json that was used:
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "blazorwasm", "name": "Launch and Debug Blazor WebAssembly Application", "request": "launch", "browser": "edge", "hosted": true, "program": "${workspaceFolder}/BlazorTest.Server/bin/Debug/net7.0/BlazorTest.Server.dll", "cwd": "${workspaceFolder}/BlazorTest.Server", "url": "http://localhost:5000" } ] }

Works fine on FsBolero though.

@albertwoo
Copy link
Contributor

Are you using mix mode template. If so, it may not work. I only tried pure WASM mode. And only updated pure WASM mode template. And I only tried on VS for Windows.

@albertwoo
Copy link
Contributor

Today, I also tried the latest pure WASM template in VSCode, the generated default launch.json is working fine with the debug too:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch and Debug Standalone Blazor WebAssembly App",
            "type": "blazorwasm",
            "request": "launch",
            "cwd": "${workspaceFolder}"
        }
    ]
}

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

No branches or pull requests

2 participants