AspNetCore.Docs/aspnetcore/mvc/views/view-compilation.md

908 B

title author description keywords ms.author manager ms.date ms.topic ms.assetid ms.technology ms.prod uid
View compilation | Microsoft Docs rick-anderson View compilation ASP.NET Core,view compilation, pre-compilation, precompilation riande wpickett 03/24/2017 article ab4705b7-1638-1638-bc97-ea7f292fe92a aspnet asp.net-core mvc/views/view-compilation

View compilation

By Rick Anderson

View compilation

Razor views are compiled at runtime when the view is invoked. ASP.NET Core 1.1.0 and higher can optionally compile Razor views and deploy them with the app. To do this set MvcRazorCompileOnPublish to true and include a package reference to Microsoft.AspNetCore.Mvc.Razor.ViewCompilation. The following .csproj sample highlights these settings:

[!code-htmlMain]