ASP.NET application in virtual folder uses web.config of application in website root folder

I have several ASP.NET applications in virtual folders (already configured as applications and with different application pools), but I want to install another ASP.NET application that will be redirected to one of the virtual folders according to some criteria (from the database and cookies).

All applications in virtual folders work fine, but if I install the root application, I get some errors about the repeated settings of web.config.

A workaround would be to create another virtual folder for the redirecting application and use HTML redirection on the root site.

However, I would like to know if it is possible for a web application in a virtual folder to skip the web root web.config in the .config hierarchy.

Thank,

Luis Alonso Ramos

+5
source share
1 answer

One option is to move all web.config settings to a location path where you use the inheritInChildApplications attribute so that these settings apply only to the parent application and not to the child applications, for example:

<location inheritInChildApplications="false">
... move all your settings here...
</location>
+2
source

All Articles