Override web.config in an ASP.NET sub-application

IIS 7.NET 4.0 I have a website with 4 sub-web applications. 3 of them need settings from parent-web.config. You need to have a completely independent web.config (without inheritance). I know about the ability to disable inheritance for sub-applications. But I need a way to disable it for only one sub-application! (without each separate section. Therefore, I am looking for something like the "dontInheritParentConfig" parameter in my sub-web.config

Thanks!

+4
source share
1 answer

In .net 4, you can use the Web.config conversion syntax to deploy a web application project . This is a template change for web.config to allow the file to differ in different scenarios, which should suit the needs of your application.

Web.config files usually include settings, which should be different depending on whether the application is running. For example, you may have to change the database connection string or disable debugging when deploying the Web.config file. For web application projects, ASP.NET provides tools that automate the process of changing (converting) Web.config files when they are deployed. For each environment that you want to deploy, you create a convert file that only indicates the differences between the original Web.config file and the deployed Web.config file for that environment.

0
source

All Articles