Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Commented Issue: RazorGenerator.MSBuild is too aggressive when finding .cshtml files [90]

$
0
0
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.

(e.g. App_Data\TEMP\Razor folder is a cache folder used by umbraco and is not part of my MVC project)
Comments: This definitely causes an issue when using Visual Studio 2010's publish functionality (I can't vouch for 2012). In these cases, the files that will be deployed, which can include .cshtml files, are copied in to a directory under the "obj" folder. Razor Generator will pick up these files by default and it causes problems when trying to pre-compile views. Adding the following to my project file did resolve the issue, but caused all of my Razor views to show up twice in the solution explorer (since RazorSrcFiles get treated as a new build action): ``` <ItemGroup> <RazorSrcFiles Include="**\*.cshtml" Exclude="obj\**\*.cshtml" /> </ItemGroup> ``` I will try the suggestion from the previous comment and create a separate targets file for the ItemGroup

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>