How do you isolate a sub-application from the main site on IIS7
Senario:
I am running IIS7 on Win Server 2008 web server
I have an MVC application on a website route (main application)
HOST website - domain.com
I created a virtual app / testapp with an ASP.Net app (under the app)
Problem:
when I go to http://domain.com the main app works as expected, but when I go to http://domain.com/testapp a similar app works but handles the main web.config app.
Some of the errors I have encountered are missing missing DLLs that are only required by the main application - this can be solved by copying the dll to the helper application bin folder, but is not a perfect solution.
Question:
I don't think this is an MVC / ASP.Net issue, but ISS7 instead. How do I configure IIS7 so that these two applications don't interfere with each other?
a source to share
This is a design issue due to the inheritance of web.config files. You have several solutions:
- Move the site elements in the site root to the application subfolder next to the other application and remove as much of the parent web.config as possible.
- Copy all the parent web.config elements to the child web.config that you need and use the elements
location
to block inheritance from the child:
< location path="." inheritInChildApplications="false" >
< system.web >
...
</ system.web >
</ location >
a source to share
I had a similar problem when I was adding custom modules in my ASP MVC 4 application, running on IIS7. I found a solution by simply removing and adding the module like so:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="GlobalizationModule"/>
<add name="GlobalizationModule" type="GlobalizationHttpModule, MyWebSite"/>
</modules>
</system.webServer>
This is a specific solution to this problem, hope it helps.
ido.
a source to share