We have a large content management system configured as the main site in IIS. We also have a handful of independent applications that are configured as applications under IIS 7.5. The issue that we’re running into is that the child applications are inheriting the web.config file from the parent application even though they are completely independent applications and share next to no configuration settings. Ideally, we’d like to stop the child applications from inheriting the web.config file at all. Is that possible?
If not, we’d like to tell the child applications not to inherit parts of the master web.config file. We’ve tried editing the child web.config files and adding directives to the configuration file, but that doesn’t seem to be working.
I understand that we can modify the parent web.config file to add in directives to effectively restrict the inheritance; however we’re hesitant to do this because we’re not sure how that will impact the CMS. The web.config file in question is also about 1000 lines long and we’re not sure how many changed we’d need to make. We can, of course, move forward with this solution and test thoroughly, but I’d rather find one that doesn’t require modifying the parent application.
We’ve also tried updating the child web.config files to manually remove certain elements of the parent web.config and we’ve had mixed results. We can unload HTTP handlers and things like that, but we can’t seem to unload any of the references to the App_Code folder.
In short, is it possible to have a child application NOT inherit any part of the web.config file? If not, is it possible to overwrite or otherwise force the child to ignore settings in the parent web.config file?
Thanks
Dave
Yes you can have two web. config files in application. There are situations where your application is divided in to modules and for every module you need separate configuration.
The Web. Config settings are inherited automatically from the root application, and it may raise a problem to run the Dashboard Service at IIS. To overcome this, use the location tag with path value as '. ' and inheritInChildApplications as 'false' in the Web.
The web. config file is required at the root of the app to enable the publishing of multiple apps using Web Deploy.
A web. config file is a Windows file that lets you customize the way your site or a specific directory on your site behaves. For example, if you place a web. config file in your root directory, it will affect your entire site (www.coolexample.com).
In addition to using <clear/>
or overwriting the settings in the child web.config, you can use the inheritInChildApplications setting in conjunction with in the parent web.config.
Example:
<location path="." inheritInChildApplications="false">
<system.web>
<!-- ... -->
</system.web>
</location>
You can wrap the location around the entire <system.web>
or just around specific sections.
Some links for more info:
This is a bit of a workaround, but what we do for polygot apps is to reverse proxy anything that can't live under the parent's web.config. Lot easier than fighting it in most cases.
Now, this intranet app sounds like it might be using windows auth, if so that won't work as you can't reverse proxy windows authentication.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With