. Net packaging Experience Summary

Source: Internet
Author: User
Tags ftp site
After creating a web application, we need to consider how to deploy and release it. In general, try to simplify the installation so that users can have a very good user experience. However, in some cases, the installation program may have high requirements. For example, you may need to write some installation configuration information to the Registry. How can I install and deploy a web application? This is somewhat different from installing and deploying an application under a common winform. In the past, it was always very difficult to install and deploy Web applications, but since ASP. from NET 1.1 until now ASP.. NET 2.0, it is very easy to install and deploy Web applications. This article focuses on how to use Visual Studio. NET express beta/Visual Studio 2.0 to install and deploy Web applications under ASP. NET 2005.

First, let's take a look at what Web applications generally include. A Web application generally includes a web page (. aspx files and HTML files), various configuration files (such as web. config), various related resource files, as well as various source code files including Core Business Code, these files are generally placed in a virtual directory of the Web server. Because ASP. NET adopts the compiling architecture, it also includes various DLL files after compilation, which are placed in the bin directory. To deploy a web application in. NET 2.0, you can use the following methods:

1. Use xcopy for deployment

2. Use the copy web site function of Visual Studio for deployment

3. Use precompilation pre-compilation and deployment of Visual Studio

The following three methods are described respectively:

  Use xcopy for deployment

First, use Visual Studio express to create a web site, select VB. NET or C #, and then create an application named deployment. In this application, because our purpose is to focus on installation and deployment, you can pull a button and then in The onclick event of this button, write some screen output statements.
After the program is compiled, we start to use xcopy to deploy the application. Xcopy is the simplest method for. NET application deployment. Xcopy simply copies all files of your web application to a specified path on the target server. For example, run the following command:
Xcopy D:/intetpub/wwwroot/myprojects/developer/deployment C:/temp/e/k/R/O/h/I

After the command is executed, the result is as follows: all files of the current application deployment will be copied to the temp directory of drive C. Then, create a virtual directory in IIS and point to the directory. For how to use xcopy, refer to the relevant Command help.

  Use the copy web site function of Visual Studio for deployment

Visual Studio's copy web site function allows us to conveniently deploy and install Web applications. By using this function, you can copy a web project to the same server, other servers, or FTP. However, when using this function, you only need to copy the file to the destination path without executing any compilation operations.
In Visual Studio Express, select copy web site from the web-site menu. The following dialog box is displayed:

The left part is the source web site path and the right part is the target path to be deployed. Pay attention to the drop-down selection box under move files on the right, which provides three file replication methods for you to choose from:

1. All source web files to remote web site (all web files are copied to remote web sites)

2. All remote web files to source web site (all remote web site files are copied to the local site)

3. Synchronize source and remote web sites (Synchronize files of local and remote web sites ).

Click connecting... The following dialog box appears:

Here, you can select where your local web application is copied, such as file system (local file system), local IIS (local IIS server), and FTP site, or remote site. After selecting the target path, you can click the "Copy web site" button. The system automatically copies the files of the application system to the target path and displays the copied logs.
 Use precompilation pre-compilation and deployment of Visual Studio

ASP. A new feature in net 2.0 is dynamic compilation, which allows you to directly access the webpage after editing or saving the modified webpage, without re-compiling, however, this has a disadvantage. The compilation process will lead to the first request to ASP. the response speed of the net page is slower than that of subsequent requests, while. in NET 2.0, precompiling is also provided. With this function, the results can be immediately displayed to the first user, any errors on the ASPX page can be detected during the batch compilation process. However, batch compilation does extend the application startup time and must be embedded in the web. config file.

ASP. NET 2.0 pre-compilation can be divided into two types. The first type is in-place compilation. You only need to enter http: // site name/webapp name/precompile in the browser. axd, the system will compile all the pages in the webapp first, after running, as shown in:

ASP. NET 2.0 provides an update compilation and deployment method called precompilation deployment ). Net Framework 2.0 provides a command line tool (aspnet_compiler.exe) to compile all the code, pages (including HTML), and static files in the webapp into the DLL and deploy the webapp, the obtained target system only contains the compiled DLL, and even HTML page files do not exist. This greatly enhances the security of the system, but browsing is similar to common ASP. NET applications. The usage is as follows:

Aspnet_compiler.exe can be found in the. NET Framework 2.0 subdirectory under the WINNT directory in the following format:

Aspnet_compiler-V/ -P

Specifically, websitename is the virtual directory name of the Web application to be deployed,The physical path of the Web application to be deployed. <destination> is the physical path of the application to be deployed. For example:

Aspnet_compiler-V/deployment
-P c:/inetpub/wwwroot/myprojects/developer/deployment C:/compiled

All files will be pre-compiled to the compiled directory of drive C. In this directory, you will find that there are no code files or HTML files.

  Summary

This article briefly introduces three web application deployment methods in ASP. NET 2.0 and introduces their respective features. For more in-depth discussions on deployment and installation in. NET 2.0, refer to msdn.

 

Summary: after more than a month of project development, I felt very tired. At the end of the project, the customer asked me to deploy the project. So I found some materials, tried several times, and set up packaging for multiple projects, in practice, I use the precompilation pre-compilation deployment method. This method is relatively safe. When packaging, pack the DLL you need and the corresponding ASPX page file, after installation and deployment, note that.. Net version. Otherwise, the analyzer error message "connectionstrings" is displayed, which cannot be identified. After modification, the system is installed and deployed normally. sometimes it is easy to find and solve problems quickly when you are in a good mood, and the mood is really bad. especially for some bad customers. finally, we provide links and post for several materials.

1. the user is automatically prompted to install the. NET Framework during packaging.

2. How do I specify an installation directory for Asp.net?

3. Create a desktop shortcut

4. prompt the user to enter the serial number

5. SQL database deployment

Link:

Http://gistoy.cnblogs.com/archive/2005/12/08/292882.aspx

Asp.net deploy database, Start Menu, desktop shortcut instance

Http://www.cnblogs.com/adandelion/archive/2006/02/12/aspnetdatabasestartmenue.html [Up]

Http://adandelion.cnblogs.com/archive/2006/02/12/329132.html [Down]

Microsoft Visual Studio. NET 2003 Bootstrap plug-in

Http://www.microsoft.com/downloads/details.aspx? Familyid = 627921a0-d9e7-43d6-a293-72f9c370bd19 & displaylang = ZH-CN

Install and package Asp.net and SQL together

Http://www.soft180.com/article/1/3/2006/20060217695.html

Program for deploying. NET platform

Http://blog.csdn.net/zhzuo/archive/2005/05/31/385140.aspx

. Net Deployment Guide

Http://www.uml.org.cn/net/netbushu.htm

 

Search keywords: Custom MSI Installation

Post:

Deployment. the client system needs to install the corresponding version of the program written in. net. net Framework, and. the installation program project of Net does not provide the function of packaging the framework together, which makes many developers feel uncomfortable. On the csdn Forum, some people also mentioned how to conveniently put it.. Net program is deployed on a Windows system without a framework installed. A few months ago, I downloaded the microsoftvisual Studio. NET 2003 Bootstrap plug-in (in fact, Microsoft provided it as early as the end of 2003, but I have never found it ). I installed this plug-in some time ago and found that no corresponding command was found in the menu and toolbar of vs.net 2003. It was strange because it was similar to. after the net2003 plug-in is installed, it will be displayed in the server resource manager, so I always thought that there was a problem and then I didn't care about it.

Last month, I had A. NET application that needs to be packaged. I was surprised to find that there were several more files in the same directory of the installation file, and finally understood what was going on. The following is a list of compiled files: config. ini -- install the configuration file dotmanagementserver Installer. MSI --msiinstaller dotnetfx.exe --. net1.1 frameworklangpack.exe -- Language Pack settings. ini --configuration file setup.exe -- main Installer Config. ini The file content is as follows:[Config. INI] ids_not_single_instance = another version of the installer is running. This application can run only one version at a time. Ids_dialog_caption = % s when installing ids_single_instance_fail = createmutex, you cannot check and assign a handle to a single instance. Ids_setup_failure = % s Installation failed. If the problem persists, contact the product support staff. Ids_default_productname = Application ids_settings_init_failure = installation setting file '% s' error during parsing, or the file cannot be located. Ids_create_process_failure = CreateProcess operation on the following command line failed: % S. Ids_insufficient_privileges = the permission of the local system administrator is required to run the % s installer. The installer is now logged out. Ids_dialog_text = click "OK" to start installing % 1. Click Cancel to exit the installation. Ids_error_caption = % s installation error ids_version_detect_failed = % 1 Version Detection failed. Make sure that the installer exists in the specified location. % N returned message: % 2ids_msi_not_found = unable to locate the product installer '% s '. The installer is now logged out. Ids_reboot_query = Installation complete. Restart now? Ids_setup_succeeded = installation successful. Ids_invalid_langid_caption = Invalid Language Pack code ids_fx_not_found = the. NET Framework EXE file '% s' cannot be located '. The installer is now logged out. Ids_invalid_langid_message = the Language Pack code % s is invalid. Skip... ids_langpack_not_found = the Language Pack % s cannot be located. The installer is now logged out. Ids_mdac_not_found = the mdac exe file '% s' cannot be located '. The installer is now logged out. Ids_file_not_found = '% 1' cannot be located '. The installer is now logged out. Settings. ini The file content is as follows:[Bootstrap] msipath = dotmanagementserverinstaller. msiproductname = service aggregation Management System mdacversion = 2.71 bootstrapfx = truefxinstallerpath = languageid = 2052 bootstraplangpack = truelangpackinstallerpath = bootstrapmdac = false I deployed the program in Windows on Microsoft virtualpc, the entire installation process is as follows: Click the installation program> prompt to confirm the installation, cancel the launch of the installation> the system is not installed. net framewrok prompts whether you want to install Mircrosoft. net Framework 1.1 Software Package> If IE 5.01 or later is not installed, the system prompts you to install ie later>. net Framework 1.1 installation> prompt to install Microsoft. Net Framework language kit> install the Application Wizard> prompt that the installation is successful. Click to run the program. Everything is as expected. I believe many people are using this plug-in, but more people may not have used this silly plug-in. Online. net Program deployment has many related articles, the following I think is better: Custom MSI installation of movie Visual Studio. net redistribution. net Framework deployment anddeployment projects to make your own installer example: http://msdn.microsoft.com/library/en-us/vsintro7/html/vbconDeploymentScenarios.asp

 

 

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.