Web.config is an xml-based configuration file that is configured to configure the application, and the following describes the hierarchical relationship of web.config files in asp.net
Web.config is an xml-based configuration file that is used to configure the application, such as a customer authentication method, role-based security technology strategy, data binding
Fixed methods, remoting objects, and so on.
Can be in the root directory and subdirectories of the site to establish their own Web.config files, can also be a Web.config files are not established, Web.config is not a prerequisite for the site files. This is because the server has a general configuration file named "Machine.config", which is installed by default in the directory of the C:windowsmicrosoft.net Framework (version number) config. This profile has been identified with the basic configuration of all asp.net applications, and is not normally modified to affect the normal operation of other applications.
There is a hierarchical relationship between Machine.config and Web.config files, and Web.config files for each directory. The web.config of the root directory inherits the Machine.config configuration, and the subdirectory inherits the configuration of the parent directory web.config. A configuration with the same name as the parent directory is automatically overwritten only if there is a new configuration in the web.config of a subdirectory.