Deploying the web.config Configuration File

The web.config usually resides in the root directory of your web application, and its settings are applied to all child subdirectories therein; however, each subdirectory can also have its own web.config file. Take a look at the following directory structure shown in Figure 3.1, and I will explain why.

Figure 3.1. Example of a web directory structure.

In Figure 3.1 a web.config file is placed in the \WebRoot directory. Any ASP.NET code processed in that directory or any subdirectories therein use the settings in the web.config file.

Also, a web.config file is in the \Application subdirectory, which ...

Get Inside ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.