Three options for Asp.net website publishing

Source: Internet
Author: User

 

When publishing a website, there are three options, and many people do not know how to use them. Let's simply say:
 
 The first option specifies whether the aspx file can be modified after the release. If this option is selected, the post-release website behavior is similar to ASP. NET.1.1 consistency. As long as no add, delete, and modify controls are added, you can directly modify the aspx file on the server without re-publishing the website.
 
 The second option specifies whether to compile each aspx file into a DLL file. In this way, you can modify the aspx webpage (including the aspx and CS files ), you only need to update a DLL file. You do not need to update the entire site.

 

1. Allow update of this pre-editing site

After this item is selected, the compiled aspx files and DLL files are the same as those in 2003.
If this item is not selected, the compiled aspx has no interface information and only one static text, that is, the page cannot be modified after being published.

To prevent users who subscribe to the website from experiencing significant latency when opening the page for the first time, you can use the full pre-compilation method.
If you want to ensure the maximum security of this compilation method, remove "allow update of this pre-compilation site (allow this precompiled site to be updateable ".CodeFiles (Code, CS files) and content files (content files, that is, aspx) are pre-compiled.

2. Use a fixed name and a single pageProgramSet

Compile a lot of DLL with fixed names based on the class names on the screen.

3. enable strong naming for pre-edited assembly
In most cases, the full pre-compilation method is exactly the required method, but sometimes because the content file does not change much, you may want, you do not need to compile all the code and content files every time. Maybe you do not need to compile the content file again. You only need to compile the code file. In this case, select "allow update of this pre-compiled site". This method is called "only pre-compiled code files (pre-Compilation of code only. this method is different from the full pre-compilation method, that is, the content file is still the original version, rather than the stub version, and the other effects are the same. after a content file is published, it can also be edited. Its changes will take effect when future requests arrive, which is transparent to users who access the site.

Appendix:
Strong naming is required if an Assembly needs to be shared. A strong name uniquely identifies an assembly. it consists of four parts: 1, assembly name (excluding the file extension); 2, version; 3, culture; 4. The key pair (a public key and a private key) is stored in the key file. Therefore, the key file contains both the public key and the private key, this key file is required when a strong name is used. run the Sn-K keypair command to create the key file. SNK

Delayed Signature: Obviously, every company's private key must be stored securely, which brings about a dilemma: when developing and testing a shared assembly, you must use a strong naming method, and you must access the private key when creating a strong naming method, however, the company's private key cannot be provided to all developers who participate in project development and need to create strong names. What should I do? In this case, we need to use the "delayed signature" technology. in this way, when creating a strong name assembly, you only need to provide the public key, because the public key is allowed and secure for all people, developers can perform program development and testing until they prepare for the final build. the delayed signature must be extracted from the key file to form an independent public key file. Run the command Sn-P keypair. SNK publickey. SNK. in this way, publickey. SNK only contains the public key.

Problems

Visual studio2005 separates website development and website release directories, which is a good setting.
However, every time a website is published, the DLL file of the website will generate a random name, and the classes inherited by the page will inherit the random name.
This causes a slight modification. After the website is published, all the pages must be uploaded again.
If the "fixed name and single-page assembly" method is used, too many DLL files will be generated, which will upset you. 

Solution

Installation:  
Http://download.microsoft.com/download/9/4/9/9496adc4-574e-4043-bb70-bc841e27f13c/WebDeploymentSetup.msi
    
Right-click to generate an add web deployment project in the current solution. In this project, you can set the DLL generation naming method. A website can be generated after the project is generated! The functions of the original website can be retired!

Refer to Microsoft's original article

Http://msdn2.microsoft.com/en-us/asp.net/aa336619.aspx

Using webdeployment project to improve the foundation of website publishing in vs2005 (I)

When the website is published in vs2005, the DLL file generated does not generate the rule like vs2003. The generated DLL file name contains a random number and cannot generate a DLL file for a project. It is a pity that, in order to do the same thing as vs2003, microsoft released the webdeployment project plug-in to solve this problem:

1. After the download is installed, right-click the project in vs2005 and a "add web deployment project" option will appear"Http://www.cnblogs.com/chy710)

2. Select to add a webdeployment Project (enter the assembly name and publishing address)

3. An additional project will be included in the solution.Http://www.cnblogs.com/chy710)

4. Right-click the project to set the corresponding properties

5. Right-click the project and select "generate". At this time, the website will be published to the specified directory, and the DLL file will be generated in the same way as vs2003. When updating, you only need to upload the DLL file.
Http://www.cnblogs.com/chy710)

I found this error during running,

Error 1: Repeated aspnet_merge.exe "has exited and the code is 1. C: "Program Files" msbuild "Microsoft" webdeployment "v8.0" microsoft.webdeployment.tar gets 574 9 daishusite

Later, I checked it online. Because the class has the same name.

Generate and run the VS 2005 tool-options-project and solution-, set "msbuild project generation output details", and select "details ". After the Web deployment projects project is created again, the information in the "output" box becomes very rich. In this way, you can view the error information.

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.