Hot reload not working for Razor page VS2022

Viewed 379

enter image description here

I just installed Visual studio2022 and create a project.NET6 web application with Razor page. But I found that Hot re-load doesn't work even for little changes("TEST" to "TEST1" in screenshot) on Index.cshtml but error popup said "Edits were made which cannot be compiled. So I had to re-build the project to see the changes. But somehow it works when I use start without debugging.

Could anyone please help on this.

  • currently I have both VS2019 and VS2022 installed on my laptop.
1 Answers

I don't know that his is the best solution, but you can disable edit and continue so that you don't keep getting prompted. Go to Options->Debugging->General and unselect the 'Enable Edit and Continue and Hot Reload' option. Obviously if you want Edit and continue you may not want this as your solution. VS options

Related