The build fails if an MVC web project is set to build views, and a view references a dependency in a project reference.
To recreate:
Create a new MVC 3 project, called MvcApplication1
Create a new ClassLibrary project, called ClassLibrary1
Add a project reference to ClassLibrary1 from MvcApplication1
Enable NCrunch
Edit MvcApplication1.csproj to change the line:
<MvcBuildViews>false</MvcBuildViews>
to
<MvcBuildViews>true</MvcBuildViews>
(at this point it should still be building)
Edit \Views\Home\Index.cshtml, adding the line @using ClassLibrary1 at the top of the view.
NCrunch build now fails with@
c:\Users\XXXXX\AppData\Local\NCrunch\8528\15\MvcApplication1\Views\Home\Index.cshtml (2): The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?)
My guess is that something funny is going on with the aspnet_compiler not finding the project dependency.
Any way of fixing this?
Thanks,
Simon.