What is the scope of ASP. NET configuration settings? What is the role in our practical application? Next we will start to explain.
ASP. NET configuration settings have different scopes-some have global scopes, and some are only valid for application scopes (root Web. config file or Machine. config file.
ASP. the scope of the configuration section set for NET configuration is in Machine. the allowDefinition attribute of the section element (General setting architecture) element of configSections In the config file is included in ASP.. NET. For example, the authentication element (ASP. NET setting architecture) element has the allowDefinition attribute of the MachineToApplication element. This means that the authentication element can be set in the application-level Machine. config file, root Web. config file, and Web. config file. If it is set at the subdirectory level, an error is thrown. If the allowDefinition attribute is not defined for a section, the default value is Everywhere.
The "configurable location" in the "Element Information" table lists the configuration setting range of each element in ASP. NET configuration settings and general configuration settings (ASP. NET.
The following table lists the levels of each file in the configuration hierarchy, the names of each file, and descriptions of important inheritance features of each file.
Configuration level |
File Name |
File description |
Server |
Machine. config |
The Machine. config file contains the ASP. NET architecture of all Web applications on the server. This file is located at the top of the configuration merging hierarchy. |
Root Web |
Web. config |
The Web. config file of the server and the Machine. config file are stored in the same directory. It contains the default values of most system. web configuration sections. During running, this file is merged from the second layer of the configuration hierarchy from top to bottom. |
Website |
Web. config |
The Web. config file of a specific website contains the settings applied to the website and inherits all ASP. NET applications and subdirectories of the website. |
Root directory of ASP. NET Applications |
Web. config |
The Web. config file of a specific ASP. NET application is located in the root directory of the application. It contains settings applied to the Web application and inherited to all subdirectories in its branch. |
ASP. NET application subdirectory |
Web. config |
The Web. config file of the application subdirectory contains settings applied to this subdirectory and inherited to all subdirectories in its branch. |
Client application directory |
ApplicationName. configApplicationName. config |
The file contains settings for Windows client applications rather than Web applications. |
This section describes ASP. NET configuration settings.
- Analysis of embedded code block application in ASP. NET web pages
- Analysis on SQL Server Database Backup Recovery in ASP. NET
- Analysis of Theme functions in ASP. NET development skills
- Analysis of ASP. NET configuration file format
- Analysis of ASP. NET Configuration File hierarchy and inheritance