Enable ASP.NET Core 7.0 Runtime compilation Leave a reply Install the package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation In Program.cs add AddRazorRuntimeCompilation() to builder.Services.AddControllersWithViews() builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();