'.net 6 blazor wasm hot reload not working
I'm using Visual Studio 2022 and created a new Blazor webassembly app and ran it. The option for hot reload on file save is checked.
If I make changes in the Counter component (either HTML or C# code changes) and save the file I see a tick symbol appear at the top left of the browser but neither of the changes have kicked in, the browser just continues with the old version.

After the change the counter still increments even though I changed it to decrement and the h1 title doesnt include the 2 after it.
Solution 1:[1]
So i've worked out that it only works if you run the project without debugging, not with debugging.
Ctrl + F5 (hot reload works), F5 (doesn't work)
Solution 2:[2]
I was using the visual studio IDE 2022 v17.0.1
Updated the visual studio IDE 2022 to v17.1.2 supported the blazor hot reload
Note: Help -> Check for updates
Solution 3:[3]
I can confirm what The Thirsty Ape suggested works when running Visual Studio 2022 and .NET 6
dotnet watch --project .\your-project-name-here.csproj
The browser will launch and the console should display something like:
watch : Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. Press "Ctrl + R" to restart.
And finally after making a code change:
watch : Hot reload of changes succeeded.
No refresh is required
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Paul |
| Solution 2 | Abishek G.C. |
| Solution 3 |

