Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 redirect to one of the virtual folders according to some criteria (from database and cookies).

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

A workaround would be to create yet 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 website-root web.config in the .config hierarchy.

Thanks,

Luis Alonso Ramos

like image 331
Luis Alonso Ramos Avatar asked Nov 06 '22 10:11

Luis Alonso Ramos


1 Answers

One option is to move all the settings of the web.config to a location path where you use the inheritInChildApplications attribute so that those settings are only applied for the parent application and not child applications, something like:

<location inheritInChildApplications="false">
... move all your settings here...
</location>
like image 137
Carlos Aguilar Mares Avatar answered Nov 11 '22 15:11

Carlos Aguilar Mares