The MSBuild extension is trying to pre-compile *all* .cshtml files it can find under the project root, instead of just the ones that are in the project. This is a bit of a problem when working in a hybrid app where a CMS such as Umbraco is managing it's own razor templates in the same web application.<br /><br />(e.g. App_Data\TEMP\Razor folder is a cache folder used by umbraco and is not part of my MVC project)
Comments: I can't remember correctly, but there was some edge case scenario that wasn't working correctly when we were looking for Content and None items in the project. That said, you should be able to specify the cshtml files that the target should precompile from your csproj Check the Customizing the target file section at http://razorgenerator.codeplex.com/wikipage?title=Using%20RazorGenerator.MsBuild If you specifically want it to pick up files from your project, you could tinker with passing it something like this <RazorSrcFiles Include="%(None)" Condition=" '%(None.Extension)' == '.cshtml' " /> <RazorSrcFiles Include="%(Content)" Condition=" '%(Content.Extension)' == '.cshtml' " />
Comments: I can't remember correctly, but there was some edge case scenario that wasn't working correctly when we were looking for Content and None items in the project. That said, you should be able to specify the cshtml files that the target should precompile from your csproj Check the Customizing the target file section at http://razorgenerator.codeplex.com/wikipage?title=Using%20RazorGenerator.MsBuild If you specifically want it to pick up files from your project, you could tinker with passing it something like this <RazorSrcFiles Include="%(None)" Condition=" '%(None.Extension)' == '.cshtml' " /> <RazorSrcFiles Include="%(Content)" Condition=" '%(Content.Extension)' == '.cshtml' " />