ASP. Network 2.0(New book serialization)
ASP. NET 2.0 supports two compilation models: dynamic compilation and precompilation ).
The new book [ASP. NET 2.0 expert technical manual of the temple priest]
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 the compilation model should be used for different websites. This not only greatly improves the flexibility, but also improves the website execution efficiency if the website is compiled first, 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 file, 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. asax file types will trigger the system to perform dynamic compilation as long as they have changes, but this mode has a very obvious problem, components, resource files, and Web Services under the bin directory are often modified during the program design stage. However, these files will not trigger the system to re-Compile when using changes, therefore, every. NET 2003 project changes, you must manually re-compile the entire project, 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 during changes is also supported for categories, web services, dataset, master pages, and themes. You only need to refresh the IE browser to automatically trigger system re-compilation, what we see is of course the latest image, saving the need for programmers to manually compile it, which 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 project, many ASP. NET 1.0 programmers began to panic, confused, and uneasy. Why can't they find a project. 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 becomes a "heterogeneous" in your eyes, but it is the relationship between 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. copy all the config and category files to the new website (only none. DLL files), and 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 application code. In ASP. NET 1.0, code behind can be compiled into the DLL. However, if it is a program developed using in-line code or HTML 标, it does not provide 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 the program code be compiled or even connected through pre-compilation. the HTML tags in the aspx web page can also be compiled together. The protection of the program code 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 the page and program code files do not need to be compiled at the first request, users can get a faster response time, which is particularly useful for large websites that are frequently updated.
(2) Methods used by the user to identify compilation errors before browsing the Web page.
(3) without the original program code, you can build the ability to deploy to the actual execution server that has compiled the website version.
The use of the above two compilation models is illustrated in detail and explained in depth. However, because the blog steps and images are not easy to post, all the images must be uploaded one by one and then typed, therefore, the priest did not post the sample steps. Please refer to them when listing the books.
The new book [ASP. NET 2.0 expert technical manual of the temple priest]