0

I am using the technique described in this answer: https://stackoverflow.com/a/7167198/22399 to set up multi-project areas in MVC3. My issue, though, seems to be in configuring IIS Express, not in the technique itself.

I am doing something wrong in Step 7 (using IIS Express.) I keep getting an error saying that it cannot find the views (my test area is called "Sample") Here is the error:

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:

~/Areas/Sample/Views/Index/Index.aspx<br />
~/Areas/Sample/Views/Index/Index.ascx<br />
~/Areas/Sample/Views/Shared/Index.aspx<br />
~/Areas/Sample/Views/Shared/Index.ascx<br />
~/Views/Index/Index.aspx<br />
~/Views/Index/Index.ascx<br />
~/Views/Shared/Index.aspx<br />
~/Views/Shared/Index.ascx<br />
~/Areas/Sample/Views/Index/Index.cshtml<br />
~/Areas/Sample/Views/Index/Index.vbhtml<br />
~/Areas/Sample/Views/Shared/Index.cshtml<br />
~/Areas/Sample/Views/Shared/Index.vbhtml<br />
~/Views/Index/Index.cshtml<br />
~/Views/Index/Index.vbhtml<br />
~/Views/Shared/Index.cshtml<br />
~/Views/Shared/Index.vbhtml

My IIS Express applicationhost.config is set up this way:

    <site name="Vo.MainSite" id="5">
        <application path="/" applicationPool="Clr4IntegratedAppPool">
            <virtualDirectory path="/" physicalPath="D:\{LONG PATH}\MainSite\MainSite\MainSite" />
        </application>
        <application path="/Areas/Sample" applicationPool="Clr4IntegratedAppPool">
            <virtualDirectory path="/" physicalPath="D:\{LONG PATH}\Modules\SampleModule\SampleModule.Web" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:47001:localhost" />
        </bindings>
    </site>

Which, from everything I am googling, it should be correct. I have the post build process copying the DLL just fine. I can put a breakpoint in the SampleController and the breakpoint gets hit. Everything looks good, except finding the views. Any suggestions?

Community
  • 1
  • 1
CleverPatrick
  • 9,261
  • 5
  • 63
  • 86
  • So, I've pretty much given up on the idea of having views in separate projects for now. Putting the Controllers in separate projects is nice and easy, so I will just stick with that. But I will leave this question open for now. Hopefully one day someone will one day come up with a smooth, easy, maintainable, and supported by the tooling way of accomplishing this. – CleverPatrick Jun 07 '12 at 14:50
  • 1
    In the similar situation i edited permissions for the virtual directory by adding IIS_IUSRS with Read privilege. Views started to be found. – Almas Aug 29 '12 at 14:00
  • Have you tried Almas' suggestion? It worked for me. I have a somewhat different setup - vb.net webforms project as the main project with razor mvc3 c# project referenced from within and with Views as virtual folder. Adding permissions mentioned above (I had put IUSR originally) fixed the issue – Mihailo Sep 23 '12 at 12:43

1 Answers1

0

Be sure your views are marked as embedded resources.

AndrewBoudreau
  • 128
  • 1
  • 6