Scope of ASP. NET configuration settings

Source: Internet
Author: User

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.

  1. Analysis of embedded code block application in ASP. NET web pages
  2. Analysis on SQL Server Database Backup Recovery in ASP. NET
  3. Analysis of Theme functions in ASP. NET development skills
  4. Analysis of ASP. NET configuration file format
  5. Analysis of ASP. NET Configuration File hierarchy and inheritance

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.