About precompiledapp. config

Source: Internet
Author: User

When you use Microsoft Visual Studio 2005 to develop an ASP. NET Website, A precompiledapp. config file is generated after the website is published. The file content is as follows:
<Precompiledapp version = "2" updatable = "true"/>

This file cannot be deleted because it has been explained by netizens. Now I want to make a simple analysis on the association between the precompiledapp. config file and the events in the global. asax file.

In our multi-site design method, we will set multiple webconfig files based on different deployments. Each file has its own independent settings, therefore, we may load different webconfig files when starting the application. In this case, we need to process them in the Global File.

Example:

Void application_start (Object sender, eventargs E)
{
// Code that runs when the application starts
// Applicationconfiguration. applicationstart (this. Context. server. mappath (this. Context. Request. applicationpath), applicationenum. Site. Enterprise );

}

At this time, there is no precompiledapp. config file, and this code segment will not be executed.

 

The following is a description of some netizens:

Certificate ----------------------------------------------------------------------------------------------------------------------------------

You cannot delete the. precompiledapp. config file to track the application deployment mode and determine whether ASP. NET needs to compile any files during request.
Some application-level things cannot be used after deletion.

 

---------------------------------------------------------------------

Compile ASP. net2.0. There are three pre-compilation methods:
1. Allow UI pre-compilation updates
That is, only the CS files are compiled, and the page files like aspx are not compiled.
Ii. UI pre-compilation cannot be updated
That is, during compilation, not only the CS file is compiled, but the ASPX page file and the topic file are both compiled. Of course, the Web. config configuration file and images are not compiled.
Iii. Strong naming pre-Compilation
Instead of compiling the source file and naming the compiled file, they cannot replace your DLL file.
When completing this module, I will first consider the first two types, because using the third type is a bit of an overhead. I am wandering in the first two ways, so I have been repeatedly testing the convenience of integrating the files compiled in the first two methods with the overall test in the client's development. I want to give the client the least simple file, so I deleted the precompiledapp in the test of the second method. config file, and then let the IIS Directory point to the compiled file. The result shows "this is a mark file generated by the Pre-compilation tool and should not be deleted!" So I added the precompiledapp. config file to display the result normally. In fact, it is not so easy to find that precompiledapp. config is affected by IIS cache. In this process, you must restart IIS. The last check shows that the file is a tag, which notifies the ASP. NET Runtime Library that the application has been pre-compiled, so it cannot be properly displayed without the second method program.

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.