Debugging Blazor WebAssembly website

Debugging is the very important part in the development process. In this tutorial:

  • Learn how to debug with Google Chrome.
  • Learn how to debug with Microsoft Edge.
  • Good to know about debugging.

Currently, Mozilla Firefox does not available for debugging. This tutorial uses the project that you had built in the Building a website tutorial series.


Debugging with Google Chrome

  1. Put a breakpoint in your code. For example, in ProductList.razor as follows:

put-breakpoint.png

  1. Select Google Chrome as the debugging browser. For example:

chrome-debugger.png

  1. Once you run the website, a new browser will appear. Open the product list page to trigger the breakpoint as follows:

Debugging with Microsoft Edge

  1. Put a breakpoint in your code. For example, in ProductList.razor as follows:

put-breakpoint.png

  1. Select Microsoft Edge as the debugging browser. For example:

edge-debugger.png

  1. Once you run the website, a new browser will appear. Open the product list page to trigger the breakpoint as follows:

Good to know about debugging Blazor WebAssembly

  • Debugging with Mozilla Firefox is not supported (yet).
  • You can add arguments when launching the browser. For example, debugging Blazor WebAssembly in Microsoft Edge with a specific profile as follows:

how-to-open-browse-with.png

browse-with-windows.png

  • You must open a new browser when you want to debug. If your project doesn't launch browser when you run it, open Project properties and select DebugGeneralOpen debug launch profiles UI → Tick the Launch browser check as follows:

open-launch-profile.png

  • Using a custom template for Blazor might make your project not able to debug. Always use the default template that Microsoft provided, then add third party extension later.
BLAZOR SCHOOL
Designed and built with care by our dedicated team, with contributions from a supportive community. We strive to provide the best learning experience for our users.
Docs licensed CC-BY-SA-4.0
Copyright © 2021-2025 Blazor School
An unhandled error has occurred. Reload 🗙