Blazor WebAssembly Breakpoints not working

Viewed 1608

I'm trying to debug a Blazor web assembly app with breakpoints.

If I add a breakpoint within Visual Studio I get this message on my breakpoint.

The breakpoint will not currently be hit no symbols where loaded for this document.

I updated visual studio.

I made sure the inspectUri was added to both the client and server setting.json.

I unchecked enable diagnostic tool while debugging in settings.

I tried to run as administrator. I also tried the answer here: How do I remedy "The breakpoint will not currently be hit. No symbols have been loaded for this document." warning?

Any help will be appreciated

Regards,

1 Answers

At the begining you should know WASM debuging works on Chromium browsers like Edge and Chrome. Then make this changes.

Open launchSetting.json file, in IIS Express profile and add this code after "launchBrowser": true,:

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

Repeat it for other profiles, for example TestBlazor.WASM.

This peace of code:

  • Enables the IDE to detect that the app is a Blazor WebAssembly app.
  • Instructs the script debugging infrastructure to connect to the browser through Blazor's debugging proxy.

Those changes works well but in some cases that failed, add this "nativeDebugging": true to all profiles.

If your App hosts on another base app than /, change the properties like this:

"iisExpress": {
    "applicationUrl": "http://localhost:{INSECURE PORT}/{APP BASE PATH}/",
    "sslPort": {SECURE PORT}
}

And for each profiles:

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