As part of the build process on the apps team at Esendex, we like to be doubly sure nothing is broken by not only compiling, running unit tests, acceptance tests, integration tests AND regression tests, but also checking that all our views compile too.
There’s loads of blog posts on how to do this, quite simply open your MVC csproj file in notepad, and in your the <ProjectGroup>
node for the specific configuration you want to compile the builds add:
<MvcBuildViews>true</MvcBuildViews>
For example:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug with compiled views|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<MvcBuildViews>true</MvcBuildViews>
</PropertyGroup>