asp.net-mvcjquery-mobilerazor

How to compile cshtml before runtime


I believe I read somewhere there is a setting in one of the project files that will allow you to compile the .cshtml files when building your Visual Studio project.

Just getting started with MVC/Razor/Query Mobile, and am getting annoyed with the "Error loading page" when I have an error in a code block inside a .cshtml file


Solution

  • Set <MvcBuildViews>true</MvcBuildViews> in the <PropertyGroup> element of your .csproj file.