Reputation: 127
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?
Upvotes: 8
Views: 9285
Reputation: 341
When you get this type of error:
First click the screen with your mouse, then hit F12. Then select the Console link a top of Dev Tools Form.
Upvotes: 8
Reputation: 4533
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:
Wait a little and you will see an "inspect" button like below:
And you can even navigate in your App from there:
Upvotes: 20
Reputation: 8954
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();
Upvotes: 4