-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Break on exceptions behaves unreliably in a Blazor WASM application. I was able to get it working by doing a combination of setting breakpoints before the exception is thrown and pausing on caught exceptions. Of course, I wasn't able to reproduce the exact state I was in when I managed to get it working when drafting the repro notes here.
Configuration
Operating System and Browser
Google Chrome 85.0.4183.102
macOS 10.15.16
Note: Similar behavior was reproduced on Windows and Chromium Edge.
.NET SDK (reflecting any global.json):
Version: 5.0.100-rc.2.20459.6
Commit: 4e6d364bbb
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/5.0.100-rc.2.20459.6/
Host (useful for support):
Version: 5.0.0-rc.2.20458.14
Commit: 482494f
Reproduction Steps
-
Create a new Blazor WASM project using
dotnet new blazorwasm -o Testing. -
Open
Pages/Counter.razorand addthrow new Exception("foo")inside theIncrementCountmethod. -
Run
dotnet runand navigate to the Blazor app. Press Alt+Shift+D to open the debugging experience. You'll be directed to relaunch a Chrome session with remote debugging enabled. -
Enable "Pause on Exceptions" in the debugger.
-
Navigate to the counter page and click the increment button.
-
Observe that the JS exception is thrown in the UI (by Blazor) but not paused on.

-
Enable "Pause on caught exceptions".
-
Refresh the counter page and click the button again.
-
Observe that the debugger pauses on every exception but the one thrown.