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 (precompilation). The ASP.NET Core 2.x project templates enable precompilation.
* Precompiling views results in a smaller published bundle and faster startup time.
* You can't edit Razor files after you precompile views. The edited views won't be present in the published bundle.
To deploy precompiled views:
# [ASP.NET Core 1.x](#tab/aspnet1x)
Set `MvcRazorCompileOnPublish` to true and include a package reference to `Microsoft.AspNetCore.Mvc.Razor.ViewCompilation`. The following *.csproj* sample highlights these settings: