ASP. NET 2.0 supports two Compilation models: Dynamic Compilation and Precompilation ).
ASP. NET 2.0 supports two Compilation models: one is Dynamic Compilation, and the other is Precompilation ), the program designer can have a broader choice to determine when to use the compilation model for different websites. This not only greatly improves the flexibility, but also improves the website execution efficiency if the compiler uses the prefix compilation function, as described below:
(1) Dynamic Compilation of ASP. NET websites (Dynamic Compilation)
In ASP. NET 1.0 supports dynamic website compilation, that is, when the user first requests the website webpage, ASP. NET will first compile the website program into. dll component files, and subsequent requests will respond to this, and the execution efficiency of compiled websites is much faster than that of uncompiled websites.
However, although ASP. NET 1.0 has the dynamic compilation feature, but it only supports. aspx ,. ascx, web. config or global. as long as there are changes, asax will trigger the system to perform dynamic compilation. However, this mode has obvious problems, components, resource files, and Web Services under the bin directory are often modified during the program design stage. However, these changes do not trigger system re-compilation, therefore, every. NET 2003 has a modification change, you must manually re-compile the entire tutorial, so that you can use the browser to execute the web page to display the latest modified program page.
However, many people may be bored or beginners do not know how to manually re-compile after the modification. Therefore, Microsoft has made more user-friendly improvements to dynamic compilation, currently, dynamic compilation is also supported for categories, Web services, DataSet, Master pages, and Themes during changes. You only need to Refresh the IE browser and the system will be automatically re-compiled, of course, the latest image is displayed, saving the need for programmers to manually compile it. This is a considerate improvement.
ASP. NET 2.0 dynamic compilation and ASP. NET 1.0 is very similar, but it is more perfect, and when you Build the entire Web site, it will not be generated in the bin directory. dll proprietary programs, many ASP. NET 1.0 programmers began to panic, confused, and uneasy. Why can't they find a special program. dll? How do I deploy a website without a. dll file? There are no doubts. The reason is that you are confused about ASP. NET 1.0 is a universal standard, and any violation of it is a different type, and then ASP. NET 2.0 dynamic compilation has become a "heterogeneous" in your eyes, but it is a concern of people's perseverance and localism. In fact, ASP. NET 2.0 dynamic compilation is more perfect, perfect to no longer need at all. dll, as long as a user requests, the system automatically performs dynamic compilation (still invisible.. aspx ,. aspx. cs, Web. config and category files are all copied to the new website. dll files), the rest of the dynamic compilation will take care of for you.
(2) Precompilation)
In addition to the dynamic compilation mentioned above, ASP. NET 2.0 also provides the Precompilation website function. It uses the "ASPNET _ Compiler.exe" command to pre-compile the entire website, there are several advantages for the priest to illustrate this practice from a popular point of view:
(1) saving time for the first compilation of web pages. Previously in ASP. NET 1.0, although this compilation mechanism effectively accelerates ASP. the overall performance of the. NET Website, but many users or beginners who do not know it complain that the first execution is slow, and the pre-Compilation of the entire website is saved for the first time, maybe no one will complain about this problem any more.
(2) Protect the smart property of Web code. In ASP. NET 1.0, Code Behind can be compiled into the dll, but if the program is developed with In-Line Code or HTML standard development, it does not have any protection; in addition, even if you develop Web applications in Code Behind mode, many labels will still be generated in. in aspx, this is especially true for ASP. NET 2.0 is even worse. For example, SQL commands connected to SqlDataSource are displayed in HTML. Therefore, not only can code be compiled or even connected through pre-compilation. the HTML tags in the aspx web page can also be compiled in one batch. The protection of program codes can be said to have an additional layer of protection and selection.
However, let's take a look at Microsoft's official statement on the benefits of preemptible Compilation:
(1) Because pages and code files do not need to be compiled at the first request, users can get a faster response time, which is particularly useful for frequently updated large websites.
(2) Methods used by the user to identify compilation errors before browsing the Web page.
(3) without the original code, you can build the ability to deploy to the actual execution server that has compiled the website version.