aspnet/MvcPrecompilation

Name: MvcPrecompilation

Owner: ASP.NET

Description: Tooling that allows compilation of MVC Razor views as part of build and publish. NOTE: future work on Razor compilation is now being handled in the Razor repo. See the README for more details.

Created: 2016-08-19 00:36:17.0

Updated: 2018-05-21 16:43:02.0

Pushed: 2018-05-23 22:36:35.0

Homepage:

Size: 531

Language: C#

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ASP.NET Core MVC Precompilation

NOTE: This repo is solely for maintenance of the existing MVC precompilation feature. Future work on Razor compilation is now being handled in the Razor repo. See aspnet/Razor#1740 for additional details.

AppVeyor: AppVeyor Travis: Travis

The Razor syntax provides a fast, terse, clean, and lightweight way to combine server code with HTML to create dynamic web content. This repo contains tooling that allows compilation of MVC Razor views as part of build and publish.

Installation and usage
Referencing the Microsoft.AspNetCore.Mvc.Razor.ViewCompilation package
mGroup>
ackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="1.1.1" />
emGroup>
Enabling view compilation

View compilation as part of publishing is enabled by default if you're referencing the Web SDK (Microsoft.NET.Sdk.Web) that ships with .NET Core 2.0 or later versions. For older versions, add the MvcRazorCompileOnPublish property to your project:

pertyGroup>
vcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
opertyGroup>

Alternatively, you may wire up the MvcRazorPrecompile target to a build event:

rget 
Name="PrecompileRazorViews" 
AfterTargets="Build"
DependsOnTargets="MvcRazorPrecompile" />
Options

Some aspects of view compilation can be configured by editing the project:

This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the Home repo.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.