The ASP.NET web applications that I’m working on is using multiple web.config files. One in the web root folder, and then we have another project (*.csproj) called “admin” which is located in a nested folder under the web root of the application containing its own web.config file. What ASP.NET configuration (or other configuration) is USED (or NOT USED) in the secondary web.config file? I’m in the process of upgrading Telerik’s Rad Controls and adding some new features. However, none of these controls apply to the main web application. They all apply to the admin project pages. So I don’t want to add something into the main/primary web.config file if I can help it. If you also can share any gotchas (or limitations) when using a secondary web.config, please do!
The ASP.NET web applications that I’m working on is using multiple web.config files. One
Share
web.configfiles are essentially merged through hierachy layout, as all config files are. Consider the following:The configuration mechanism in .NET allows for configuration elements to be overridden (or locked) at various stages in the configuration hierarchy, where:
machine.configis the machine level configuration – configuration here is applied to all .NET applications.web.configis the machine level web configuration – where the majority of ASP.NET modules/handlers are configured, and configuration is applied to all ASP.NET applications.applicationHost.configis the IIS7 root web configuration – the module/handler configuration items are used when the application pool is running in Integrated mode.web.configis the application-level web configuration. Configuration here is applied to the application and all child folders/virtual folders.web.configis the virtual-folder-level web configuration. Configuration here is applied to the current virtual folder and all child folders/virtual folders.If you are running on IIS <7, or IIS7 in Classic pipeline mode, the
applicationHost.configfile is not used as part of the merged configuration.The .NET configuration framework will merge the configurations all the way up hierarchy, obeying overrides and locked configuration elements where necessary.
In you case, I would imagine you need to apply configuration at the virtual-folder level in your IIS application.