r/Blazor • • Oct 10 '20

Debugging a Blazor application

Why is Blazor so fragile and near impossible to debug?
I'm creating an application, but any minor change causes the Client-side to fail and no longer load, and becomes impossible to debug.
It turns a 1 hour development effort into a week-long affair.
About ready to kick this BS project to the curb and work in React.

0 Upvotes

14 comments sorted by

View all comments

9

u/affenkonig11b Oct 10 '20

My experience is the exact opposite. You can set proper break points, inspect objects, step into/over/through and generally do everything else you can in a fully fledged IDE with any other c# project. Perhaps if you elaborate on your issue, someone could provide useful input.

2

u/SimpleTruth2753 Oct 10 '20

The latest issue has been resolved, took longer than I expected. Apparently had a page directive pointing to root on two pages. Prior to this, I spent a few days attempting to get out of the box Authentication working on client side. The server-side worked fine, but client side required some additional wiring, and it didn't debug easily. It made that transition difficult. Although I have been able to get through these issues, the task of tracking them down is more difficult than I have experienced with MVC or other .NET applications.

1

u/[deleted] Oct 10 '20

For me the biggest thing to understand is that the client is it's own application. Since it is all started from the server and they share code I assumed they were one application for a while. When that clicked it also made the whole client side of the authentication easier. Although its still a chore. Fortunately I found some good blog posts that helped me a lot.

I've also discovered that whenever you start the Blazor app, make sure you have the developer tools page open. A lot of errors show up in the console log. I'm sure that issue you had with the app not starting would show up in the console log.