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
Locate the Web. config file in the current site root folder, and then stop
Locate the Web. config file in the software installation path, stop if it exists
Asp. NET configuration Files