aspnetcore: Hotreload doesn't work on Blazor wasm (.NET6)

Hotreload doesn’t work on blazor wasm (.NET6 LTS)

I’ve created a brand new blazor wasm project using Visual Studio 2022 (Version 17.1.0 Preview 1.1) and couldn’t get hotreload to work, HOWEVER it works perfectly fine on blazor server!

To Reproduce

Windows 11 Brand new .NET6 blazor wasm project and then run “dotnet watch” as soon as something is changed it’s gonna end up with this particular message and should be restarted manually!

watch : File changed: C:\Users\alikh\source\repos\BlazorApp1\BlazorApp1\Pages\Index.razor.
watch : No hot reload changes to apply.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 15 (5 by maintainers)

Most upvoted comments

This is happening to me also. Creating a new ASP.NET Core Hosted Web Assembly app and running dotnet watch from the Server directory.

Thanks for contacting us.

We’re moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it’s very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

Umm I’m going to raise a flag here because for me it extends to the hosting environment also (meaning no clients receive updates after changes are published) and I think it’s related. Please see my comment on this same topic in another issue thread https://github.com/dotnet/aspnetcore/issues/38809#issuecomment-985967854

However it won’t be working using that certain trick for blazorwasm hosted with asp.net core 😦

Did anyone find a solution? I moved to .NET 7 November release , it is still happening. dotnet watch or dotnet watch run they work well when first editing a file, after that:

dotnet watch ⌚ File changed: ./Pages/Index.razor.
dotnet watch ⌚ No hot reload changes to apply.

This seems not to be fixed in SDK 6.0.200–when I do dotnet watch --project . from the Server directory, wait for it to spin up and load the page, then change the text on the page, I still get:

watch : File changed: C:\...\Client\...\MyComponent.razor.
watch : No hot reload changes to apply.

With --verbose, I get:

watch : File changed: C:\...\Client\...\MyComponent.razor.
watch : No deltas modified. Applying changes to clear diagnostics.
watch : Received 1 from browser in [Count: 1, MessageType: Binary, EndOfMessage: True].
watch : No hot reload changes to apply.
watch : Hot reload change handled in 5902.7638ms.

There are hot reload changes to apply. Come on, it is so close to working! Can anyone help?

It’s so bizarre actually, I just realized it works using this command “Dotnet watch --project .” is it something particularly different in that way? I couldn’t find it in official documentation, I just bumped into that one in some forums…