Context: Visual Studio 2022 v17.9.6, .NET 8 (SDK v8.0.204), Blazor Webassembly Hosted solution.
Applying Hot Reload to a non-debugging (CTRL-F5 run) webassembly app ... stopped working. At one time in the past it was working (more so with .NET 7), in a rather flakey way, as one would expect considering the limitations of certain types of edits not being supported. But I'm talking about very simple edits, like changing <p>Hi</p>
to <p>Bye</p>
in a Razor component.
In my case, it got to the point where every attempt to apply edits via hot reload would result in VS encountering an "Unexpected error" (a ManagedDeltaApplierFailedToConnectException
, to be precise) and post the following dialog box:
In other words, Hot Reload is completely broken. What is the fix?
In the index.html
file of your client project, inside the <body>
tag, near the bottom with the other script
tags, add the following
<environment names="Development">
<script src="_framework/aspnetcore-browser-refresh.js"></script>
</environment>
Then,