Yesterday I yet again experienced, that my MVC 4 build went fine when built and deployed using teamcity, but still a compile time bug sneaked into production.
Then a combination of google and talking to a friend led me to a solution. I short, this allows you to define that views should be compiled with certain targets. As compiling views increases the build time conciderably, you may want to avoid it for local development.
How to configure this is all shown here: http://www.dotnetcurry.com/ShowArticle.aspx?ID=698