7

If there is an error in the program, I get "An unhandled error has occured". With Blazor Web assembly I can open the developper tools in the browser to get the details of what happend. This is not possible in Blazor MAUI.

So how can I get the details of the error in Blazor MAUI?

Bert
  • 87
  • 1
  • 6

3 Answers3

14

There is a way to "remotely inspect" your app using the browser developer tool (F12). First, check if you added the AddBlazorWebViewDeveloperTools in your MauiProgram.cs

#if DEBUG
    builder.Services.AddBlazorWebViewDeveloperTools();
#endif

Run your App and open a new tab in your browser (outside the emulator) and type:

  • For Chrome: chrome://inspect
  • For Edge: edge://inspect

Wait a little and you will see an "inspect" button like below: enter image description here

And you can even navigate in your App from there: enter image description here

Ewerton
  • 4,046
  • 4
  • 30
  • 56
6

When you get this type of error:

Pic of Error

First click the screen with your mouse, then hit F12. Then select the Console link a top of Dev Tools Form.

Dev Tools Pic

Terrence
  • 313
  • 2
  • 12
3

You can open the developer tools by pressing ctrl + shift + i (or cmd + shift + i for Mac) when you have focus inside the web view.

Note: you need to enable the developer tools.

builder.Services.AddMauiBlazorWebView();

// enable the developer tools
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Services.AddBlazorWebView();
Cody
  • 8,686
  • 18
  • 71
  • 126