Skip to content

Instantly share code, notes, and snippets.

@corespider
Created September 19, 2020 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corespider/69a7357dda26cea7c0fb51ed7f3fea1c to your computer and use it in GitHub Desktop.
Save corespider/69a7357dda26cea7c0fb51ed7f3fea1c to your computer and use it in GitHub Desktop.
Razor File compilation-corespider
public IWebHostEnvironment WebHostEnvironment { get; }
public Startup(IWebHostEnvironment webHostEnvironment)
{
WebHostEnvironment = webHostEnvironment;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
#if DEBUG
if (WebHostEnvironment.IsDevelopment())
{
services.AddRazorPages().AddRazorRuntimeCompilation();
}
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment