Running existing MVC 4 app in virtual application under Orchard

Topics: Customizing Orchard, General
Mar 18, 2014 at 4:29 AM
I am having a problem making my MVC 4 application run under virtual application folder inside Orchard 1.7.2.

I am aware of this thread, however following recommendations from there still results in my getting 404 (NotFound handler).

My setup:
Windows 7 with IIS 7 (dev box),
Orchard built with .Net 4.5 (changed target framework for Orchard.Web),
Existing MVC 4 app
In IIS I have configured application that seats under /apply of the Orchard site
Following Orchard's web.config sections are wrapped with
<location path="." inheritInChildApplications="false">
  • system.web.webPages.razor
  • system.web & system.webServer
Pointing separate site to the same folder as "/apply" results in correct MVC app response, attempting to reach it via Orchard site result in 404 page.

Any help is much appreciated
Mar 18, 2014 at 8:34 PM
Has anyone got any ideas? Any hint would be good.
Mar 21, 2014 at 9:49 AM
I see "amazing" level of support you get from the vibrant community here. Anyway I found problem myself and in case somebody would get stuck with similar issue, here is what I had:
Solutions from this thread is correct and works, however my app had customErrors mode="On" in the web.config with default redirect to /error page. When I was hitting my app inside "/apply" virtual application it was failing for reason not related to Orchard and trying to redirect to /error which Orchard was unable to locate (should've been /apply/error) and therefore I was getting 404 page.

Hope this helps someone.
Marked as answer by dae01 on 3/21/2014 at 1:49 AM