You may find it necessary to separately manage a particular section of your web application's configuration.
Say, for instance, you want to manage a single code base (one web.config file) but you want the application to behave differently on different servers (development, QA, production).
ASP.NET 2.0 allows you to modularize a configuration section using the configSource attribute. The following is an illustrative example:
MyApp has a web.config file that specifies an external source for the appSettings section:
You can store the external file, appSettings.config, anywhere within the application, provided the configSource attribute must specifies a virtual path. Sorry, physical paths or paths outside the application are prohibited.
Getting back to the example, appSettings.config contains a well-formed <appSettings> section:
That's all there is to it! To test the retrieval of these settings, here is a simple .aspx form, testconfig.aspx: