I was unhappy after moving to .NET 6 when I discovered that changes I made to the razor weren't being automatically compiled after clicking save. I spent months having to restart the whole web server every time I made a small change to the site I'm developing. I scoured the internet looking for a solution and even communicated with a Microsoft team member, all to no avail.
Luckily, my coworker stumbled into a solution that works perfectly and I wanted to share it with other people who are having the same issue.
Just add this library to the project file and it'll start working.
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.1" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With