Asp. NET configuration Files

Source: Internet
Author: User



In the computer room charge system when the configuration file was used, then it is not very thorough to understand the configuration file. Here's a summary of some of the things you can do with configuration files.

What is a configuration file


This is used to save some of the configuration information in the project, especially the configuration information that needs to be changed later.

For example, the connection database operation, changes, the direct changes can be.

When the ASP . NET site IIS starts, configuration information is loaded in the configuration file. This information is then cached and the configuration file information is monitored during execution, and once the change occurs, it is read and cached again.


Why should I use a configuration file?


This involves the implementation mechanism of the ASP .


ASP --DLL file--JIT processing--Local machine code--cache


The above procedure is that the ASP . NET page will be compiled into a DLLwhen the first request is made.

Files, which are run by JIT programming cost code. and caches the local machine code. Therefore, the first time the ASPX page opens, it will be slower. You can call the cache directly when you run it later.


Precisely because of this. The . config file escaped from this, and when the Web application is published, It is not compiled into the DLL file. If the client changes in the future, change the Web. config file directly with Notepad. can be executed again. From this we are able to see the Web. config file's advantages in saving change configuration information.

Mention here a little more, as seen in the above-mentioned operation mechanism of ASP . The browser side simply runs the machine code. All of them . ASPX files are converted to machine code, so it is assumed that the performance of the site is optimized later. Try to use static Web pages. such as HTML , because it will improve the performance of the site. Reduces the time to compile.

Read priority (Nearest principle) now the current page looks for the Web. config file under the folder. Stop if it exists

    1. Locate the Web. config file in the current site root folder, and then stop

    2. Locate the Web. config file in the software installation path, stop if it exists

Asp. NET configuration Files

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.