Programming Microsoft ASP.NET 4 - Dino Esposito [37]
Centralized Configuration
The defining characteristic of this approach is that you have a single, centralized web.config file to maintain and can still configure subdirectories individually and independently. This feature saves you from the burden of maintaining several web.config files, but it also introduces some unpleasant side effects that in the long run can turn out to be quite harsh. For example, any change to the file results in a new compilation for all the pages in the application. If you maintain distinct web.config files, the compilation occurs only for the pages really affected by the change. Note If the path attribute is omitted in the Machinewide Settings When you develop the ASP.NET code, you typically test it on a development machine with its own copies of machine.config and site web.config files. When you deploy the application on a production box, especially in an ISP scenario, you might not be able to restore the same settings. One possible reason is that the administrator does not want you to modify the current settings because they work well for all other applications or because of security concerns. You can work around the issue by simply replicating any needed global settings into the application’s root web.config. If you are deploying your code to a service provider, you might find that many configuration elements have been locked down and cannot be overridden. (I’ll say more about this aspect in a moment.) In this case, a new application-specific Whenever possible, though, you should try to replicate needed changes into the application’s web.config. This should always be the first option considered because it makes the entire application self-contained. Unmodifiable Settings
The
Used within the machine.config file or the site’s root web.config file, the
The second