January 23, 2022

.NET 5 Blazor client hot reload

For those of you who can’t wait for the much anticipated ‘hot reload’ feature for Blazor apps in .NET 6, this article describes how to achieve something similar on .NET 5. There are some caveats to this workaround but it’s better than nothing!

Start your Blazor client app from the terminal using:

dotnet watch -p C:\MyApp\BlazorApp1\ run

Now every time you save your code, the watcher will reload the web page with your latest changes.