Search code examples
.net-corerazorrider

Razor Not Hot Reloading After .Net Core 6 Upgrade


I'm using Rider. After updating our .net Core project to 6, the razor hot reloading stopped working.

When I make a change to my razor file, if I'm running the Rider build configuration, I get this "sources are modified" message.

enter image description here

If I click "Configure in settings", this is what I see. enter image description here

If I click apply changes, and refresh the page in chrome, I still see the old version of the page without the changes I applied. There's also this little bubble in the bottom right.

enter image description here

I tried running with dotnet run and dotnet watch in the command line, and also tried debugging with Rider.

This worked before the upgrade by running the app both via the Rider configuration and the command line, making the change, then refreshing the page.

I think if I'm reading this issue correctly, this is just a known issue with Rider.


Solution

  • I think I figured it out after writing this up and looking at this answer (different issue though). I upgraded Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation to 6.0.7. I'm still getting the "Sources are modified" pop up, and have to click "Apply changes" to see my changes. It'd be great if they could just be applied automatically. But, this is way better than having to rebuild.