Web site and the purpose of the problem

Source: Internet
Author: User

For example:VS2008 When publishing the site, the bin directory for all CS generated DLL files are randomly named each time, such as the App_web_g2dnx-qj.dll, App_web_s9nor8mv.dll, this is not convenient to update the Live site, Because the dynamic library name has changed, it involves each ASPX file changing the reference declaration on the library every time:

<%@ page language= "C #" inherits= "_default, APP_WEB_S9NOR8MV"%>

Even if there is a small change in CS, because the generated dynamic library name is different, all ASPX files will have to be re-transmitted again. If you can fix the file name of the dynamic library, update the site is much more convenient, only changed the CS, rebuild the DLL file, just need to replace the DLL file is OK. We can find several practices:

1. In the "Publish Web site" option, tick "use fixed-named and single-page assemblies" for each page corresponding to a DLL, and the DLL file name is fixed (although the name looks very casual), as long as the ASPX file name does not change. This generates a large number of DLL files, which are not yet visible in the actual application.

2. Web Deployment Projects with Visual Studio2008:
Http://download.microsoft.com/download/0/5/b/05b4424b-5b9b-4961-8ec6-91e9f1741b2d/WebDeploymentSetup.msi
Simple operation is as follows:

1) Install directly after download, open VS2008 after installation;

2) There is an extra item under [Build]->[Publishing Site] [Add Web Deployment Project], or you can right-click on the site project you want to publish. Select [Add Web Deployment Project] directly, After the Properties dialog box is displayed. Set the specified name (such as Website1_deploy) and the storage directory (c:\target), add,
to see one more item in the current solution (Website1_deploy), website1_ There are a number of other properties that can be set by the deploy, which have an important default option:

Merge all outputs to a single assembly

assembly name: Website1_deploy.

3) Right-click->[build in the scenario you just added, or build Website1_deploy to generate a directory of the published files in the directory specified previously (c:\target). Go to the C:\target directory, and you'll see that all CS files in your Web project, including ASPX-related and CSS files in App_Code, are compiled into the Website1_deploy.dll file. The header of the aspx file is:

<%@ page language= "C #" inherits= "Default, Website1_deploy"%>

as long as Website1_deploy.dll The file name is fixed, and the declaration portion of the ASPX is always constant, so each time just a change to the CS file, just change the Website1_deploy.dll file on the line. The

is set only once, compared to the second to third method, without moving the code files with each ASPX file, changing the declaration portion of the ASPX file, and building the debug version of the Web Site, so this should be the ultimate.

1, First download webdeploymentsetup.msi (click to download): http://pan.baidu.com/share/link?shareid=547386&uk=486628598

2. Restart vs after installation, right-click the item appears as shown

3. Select Add Web Deployment Project appears as shown in

4. Click the OK item to have one more file as

5. Right-click on the project to select Build.

6, after the release of all Web DLL files will be compiled into a DLL file

Web site and the purpose of the problem

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.