Page not update after refresh when .cshtml changes in .NET Core

After Asp.net Core 3.0, Runtime compilation is enabled using the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package. To enable runtime compilation, apps must:

Install the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package.

Update the project’s Startup.ConfigureServices method to include a call to AddRazorRuntimeCompilation:

services
    .AddControllersWithViews()
    .AddRazorRuntimeCompilation();

or

services.AddMvc().AddRazorRuntimeCompilation();  

Source: https://stackoverflow.com/questions/54106058/why-does-page-not-update-after-refresh-when-cshtml-changes