Evolution of KB-ASP.NET 2.0 web site deployment

Source: Internet
Author: User
VS 2005 provides the Wizard to enable ASP. NET 1.1 Project can be upgraded to ASP. NET 2.0 makes people feel that they are no different until you deploy the website in a formal environment.

In ASP. NET 1.1,. NET 2003 users use code-behind to set all Aspx. CS build to a single DLL. To update CS, rebuild and copy the DLL to the official machine. If you want to use this method to handle ASP. NET 2.0 website updates, you will be dumb!

ASP. NET 2.0 has quietly changed the concept of Code-behind! First, ASP. NET 2.0 uses code-Beside instead of Code-behind, that is,. CS is directly placed on the website, and complie is activated only when the user attempts to access the website. In this case, when you want to change the. CS program, you do not have to build the DLL again, as long as you directly change the. CS content. (Back to the convenience of the ASP era, it's really ten years of things, and ten years of Hexi...) Of course, we immediately thought that the program was not regarded as light ?? This is a convenient replacement, if you want to maintain. CS program zookeeper is not exposed, so ASP. NET 2.0 proposed a precompiled web site concept (the complete precompilation model can be viewed here), which is closer to the original code-behind spirit .. CS will be compile into DLL in advance, so you only need to deploy aspx and DLL to the official platform.

Let's take a look, the code-Beside website will grow like this:

(Note: In ASP. NET 2.0, the setting. CS that is irrelevant to aspx should be placed under app_code)
Precompiled site is like this: (one. DLL for each object)

To deploy an ASP. NET 2.0 website to the official environment, there are four options:

1)Xcopy: Directly copy the example, but the code-Beside method set by the example has the question of. CS exposure.
2)Copy web site: VS 2005 is a tool built in it. It can be used to synchronize the new scripts in the case of synchronization, or you can specify to synchronize specific folder and file, but it has code-beside. CS exposed issue.
3)Publish Web: VS 2005 will perform precompile operations and upload the aspx and DLL scripts to the terminal host. However, we have no choice but to update only a certain number of cases. All cases will be overwritten !! (Including web. config,Other objects that have been copied will also be deleted)
4)Build setup Project: An Alibaba Cloud case was created to generate an MSI automatic security protection mechanism. However, if we do not plan to perform a large number of deployments, this is a bit of a suspicion of using a knife.

In reality, 3 of the above three methods is closer to the actual requirement than the scheme, but every time the design that requires "full-site update", it is not a shame to say, many people complain about this and there are some suggestions for improvement. In this case, I think the feasible method of snapshot is to publish the Web to the local disk first, and then select to copy only some of the copies to the official machine. In the future, I will explain this practice first, and wait for a convenient add-on or tool to ask the market. (When publish web site is used, "use fixed naming and single page named lies" [see below]. In this case, each aspx has its own DLL, the name scheme will also contain the aspx name scheme to identify the differences, which is advantageous for us to update only a single aspx or its. CS failover. In practice, you can renew the subscription when the web application needs to be updated. However, when the website is large and the number of aspx files is large, the number of DLL files will reach the limit .)

at the end of the script, the precompiled site also has a special feature that can be hidden in all the volumes of the volume Aspx, the aspx stored on the website will only contain a line of text, which should be the highest level of confidentiality. When publish web site is used, cancel "allow this precompiled site to be updatable ".
the precompiledapp is displayed under the root object. there will be several items in config and bin. compiled
This Time starts. there is only one line of text. This case is only used so that IIS does not determine whether the trial case does not exist and the 404 error is returned. The real HTML content is hidden in the DLL to be deleted.

Related Article

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.