Asp. NET configuration Files

Source: Internet
Author: User



In the computer room charge system has been applied to the configuration file, at that time also a use of the configuration file is not very thorough understanding of the following to summarize some of the operation of the configuration file.

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 operation of the database connection, changes, the direct modification can be. When the ASP . NET site IIS starts, the configuration information in the configuration file is loaded, and the information is cached, and the configuration file information is monitored during the run, and the changes are re-read and cached.


Why should I use a configuration file?


This involves the operation mechanism of 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. The file, executed by JIT programming cost code, and caches the local machine code. Therefore, the first time the ASPX page is opened, it will be slower, and then directly invoke the cache when executing.


It is because of this that 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, modify the Web. config file directly with Notepad and you can run it again. From this we can look at the Web. config file's benefits of saving change configuration information.

To mention a little more here, from the above-mentioned ASP . NET execution mechanism, the browser will only execute machine code, all . ASPX files will be converted to machine code, so if the performance of the site optimization, you can use static Web pages, such as HTML , because it will improve the performance of the site, reduce the time to compile.

Read priority (Nearest principle) now the current page is looking for the Web. config file under the directory, and the presence stops

    1. Locate the Web. config file in the root directory of the current Web site and stop if it exists

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

Asp. NET configuration Files

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.