.NET Core: Enable Runtime Compilation to Allow Editing of Razor Pages During Runtime

10/10/2020 8:34:45 PM

If you are working with Razor Pages and like making edits while the site is running in Debug mode, don't expect to see those edits unless you rebuild. If you wan't to see those edits, and restore a reasonable and respectable workflow, you can make the following changes.

Install Nuget Package: Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation

Update Startup.cs

public void ConfigureServices(IServiceCollection services)
{
	...
	
	services.AddRazorPages().AddRazorRuntimeCompilation();
	
	...
}