Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hot Reload not working in Visual Studio 2022 .Net 6 Razor projects

We just upgraded all but one of our web app projects from .NET Core 3.1 projects to .NET 6 in our solution. These were ASP.NET Core 3.1 projects using Razor. Here are the results we're seeing with respect to Hot Reload:

  1. The .NET 6 projects hot reload doesn't seem to work. Hot Reload is enabled, but our Front End is never updated. Refreshing the page doesn't seem to show the updates either.
  2. The ASP.NET Core 3.1 project hot reload is working as expected.

When we run these projects in VS 2019, we can refresh the pages in any of our projects and we will see the updates. Are there some settings that we're missing here?

like image 947
user3002092 Avatar asked Nov 19 '25 03:11

user3002092


1 Answers

Big Thank you to Guru Stron! His comment in my question directed me to where I should've looked. We had to:

  1. Update our Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation Nuget package
  2. Add this to our launchsettings.json: ASPNETCORE_HOSTINGSTARTUPASSEMBLIES to "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"

This answer solved our issue - .NET Core MVC Page Not Refreshing After Changes

like image 158
user3002092 Avatar answered Nov 22 '25 04:11

user3002092



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!