I am new to ASP.NET core and I am trying to build a small web app but whenver I make a change to a view in debugging mode, I have to restart the application to see the new changes.
I tried few tricks but they did not work and even decorating a specific view with the filter
[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]
CodePudding user response:
First, Install Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
NuGet package.
Second, Update the project's Startup.ConfigureServices method to include a call to AddRazorRuntimeCompilation.
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages()
.AddRazorRuntimeCompilation();
// code omitted for brevity
}
Then you can update the page without restart the project.