Reputation: 441
We have a devops setup in which we use the "Visual studio build step" to build our solution. I have searched high and low to find out how to ensure that our cshtml views are precompiled as part of the build task, but I haven't found a solution.
Our solution is standard .Net 4.7.2 using MVC.
Our build step looks as below:
Upvotes: 3
Views: 1777
Reputation: 19451
Try to add /p:PrecompileBeforePublish=true
to MSBuild Arguments:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)" /p:PrecompileBeforePublish=true
Upvotes: 3