Add some details about view compilation options (#156)
* Add some details about view compilation options
This commit is contained in:
parent
b625ffcad6
commit
edfe5399c3
43
README.md
43
README.md
|
|
@ -6,4 +6,47 @@ Travis: [ that ships with .NET Core 2.0 or later versions. For older versions, add the `MvcRazorCompileOnPublish` property to your project:
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
Alternatively, you may wire up the `MvcRazorPrecompile` target to a build event:
|
||||
```xml
|
||||
<Target
|
||||
Name="PrecompileRazorViews"
|
||||
AfterTargets="Build"
|
||||
DependsOnTargets="MvcRazorPrecompile" />
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
Some aspects of view compilation can be configured by editing the project:
|
||||
|
||||
* `MvcRazorCompileOnPublish`: Setting this to `false` turns off all functions of view compilation that are enabled as part of publishing.
|
||||
|
||||
* `MvcRazorExcludeViewFilesFromPublish`: Enabling `MvcRazorCompileOnPublish` prevents .cshtml files from being published. This option disables this behavior.
|
||||
Note: ASP.NET Core Mvc does not support updateable precompiled views. Any modifications to published cshtml files will be ignored if a precompiled view is discovered for that path.
|
||||
|
||||
* `MvcRazorExcludeRefAssembliesFromPublish`: Enabling `MvcRazorCompileOnPublish` causes the target to prevent the `refs` directory from being published. This option disables this behavior.
|
||||
Note: Setting this option is useful if your application is using a mix of precompiled and runtime compiled views.
|
||||
|
||||
* `MvcRazorFilesToCompile`: An item group that specifies view files to compile. By default this includes all .cshtml files marked as content.
|
||||
|
||||
This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.
|
||||
|
|
|
|||
Loading…
Reference in New Issue