When I publish a ASP.NET Core MVC 2.0 Project, the Visual Studio does a complete check fore every view (.cshtml file) for variable name consistency. This is perfect for catching small errors that slip by.
How can I do this check without publishing the application, for instance during compile/build time?
1 Answers
Answers 1
All you need is to enable Razor views precompilation during the Build. By default Razor views are compiled only during Publish.
Add PrecompileRazorViews
target to your csproj file:
<Target Name="PrecompileRazorViews" AfterTargets="Build" DependsOnTargets="MvcRazorPrecompile" />
0 comments:
Post a Comment