I have a ASP.NET 4.0 web forms app and need to host an ASP.NET MVC app within the same web (i.e. within the same IIS process - same session, modules, etc.)
This works pretty easily as long as the folder/files from both are located in the root folder.
How can I cleanly allow the MVC files to be all contained within a subfolder?
I have a view engine that adds the location formats for the sub-folder. This allows all the controller/view stuff to work fine, but I need a good solution for content files. Currently, I have to be careful to ensure that all the paths in the MVC app to point to the MVC subfolder name, as in:
Url.Content("~/mvc/Content/Site.css")
What are some solid options for accomplishing this?
I don't want any requests going to or from Web Forms to be affected. This logic should only manipulate URLs that can be resolved within the MVC engine (or manipulate all URLs except URLs that can be resolved by the Web Forms engine alone)
Edit: It is a customer requirement that both sites share the same IIS Session, so a separate application is off the table for now. Not interested in sharing session between IIS processes at this point.
~/Views/folder, and any supporting files such as CSS and JS can be placed in other folders and referenced as appropriate.