Dan Sorensen
Dan Sorensen

Reputation: 11753

Can ASP.MVC 3 run in a site root and allow other ASP.Net apps to run in subfolders?

Can I have an ASP.MVC 3 application running in my site root (a simple CMS to provide MOST site content), and have it co-exist with additional ASP.Net apps (2 Web Forms apps and 1 MVC app) running in subfolders to provide more specialized functionality?

Example:

www.mycompany.com
/             // ASP.MVC 3 App goes here to handle 90% of our page content.
/store/       // Older web forms app to handle our online store.
/survey/      // Older web forms app to provide survey forms.
/locations/   // An ASP.MVC 3 app to render a map with site locations.

I wouldn't mind integrating the 'locations' MVC app with the CMS if necessary, but if they can be separate, it would simplify long term maintenance. Does the root application need to know about the others? (including the other projects as subprojects into the main MVC project in VS.2010?)

As for the 'store' and 'survey' Web Forms apps. They are running .Net 3.5, but we could recompile them to 4.0 if needed. Do the 'store' 'survey' and 'locations' folders need to be virtual folders mapped in with IIS?

Hopefully this example is simplified enough, to find out if it is possible (and how) to integrate applications together with ASP.MVC 3 running in the site root. I'm in a situation where the separate apps must share a domain and pretend to be 1 cohesive site. (They will all share the same HTML template)

Upvotes: 4

Views: 328

Answers (2)

Alexander Taran
Alexander Taran

Reputation: 6725

Just mark those other applications as Applications in IIS and that will do.

Upvotes: 4

Wyatt Barnett
Wyatt Barnett

Reputation: 15663

Not directly -- you'll be fighting nasty IIS battles all week methinks. You might be able to get there eventually but it won't be pretty. There are two potential approaches here:

a) Put the entire thing behind a reverse proxy that passes traffic to the appropriate server (or virtual server). Downside is you might have to do a little tom-foolery to convince IIS that your store is running at http://www.example.com/store instead of http://localhost:666/store but it is doable.

b) Try and incorporate the old webforms apps into your MVC cms app. Really depends on lots of specifics but could be as easy as setting the route to be ignored and tweaking config as appropriate.

Upvotes: 1

Related Questions