I was working on the UI of a Blazor Server project the other day and had this cycle going on:
- Run my application without a debugger attached (CTRL + F5 in Visual Studio)
Quick note on this, if you don’t do this you have to rebuild the project yourself before changes are visible.
- Make a few changes
- Reload browser to see the changes
- Repeat from step 2
After a little search I found that Blazor has a public API, containing everything I needed to have the browser reload when it loses the SignalR connection.
This is a really simple implementation and it might not work for your use case. Let me know if this is helpful to you or if you have a better alternative!