I have an ASP.NET 4.0 application for web forms and you need to host the ASP.NET MVC application on the same network (i.e. within the same IIS process - the same session, modules, etc. .)
This works pretty easy as long as the folder / files from both are in the root folder.
How can I completely allow MVC files to be contained inside a subfolder?
I have a view mechanism that adds location formats for a subfolder. This allows all the controller / view functions to work fine, but I need a good solution for the content files. Currently, I have to be careful that all paths in the MVC application point to the name of the MVC subfolder, for example:
Url.Content("~/mvc/Content/Site.css")
What are some reliable options for this?
I do not want any requests to come in or from web forms to be affected. This logic should only process URLs that can be resolved in the MVC engine (or manage all URLs except URLs that can only be resolved by the Web Forms engine)
Change: . The client’s requirement is that both sites use the same IIS session, so a separate application is currently disabled. Not interested in a collaborative session between IIS processes at this time.
source
share