After we have built a Web application, we need to consider how to deploy and publish. In general, simplify the installation as much as possible so that the user has a very good user experience. In some cases, there may be a higher requirement for setup, such as having some installation configuration information written to the registry. And for a Web application, how do you install the deployment? This is somewhat different from installing an application under an ordinary WinForm. In the past, it was always difficult to install a Web application, but since ASP.net 1.1, the ASP.net 2.0 that now appears, it will be easy to install the deployment Web application. This article highlights how to install a Web application using Visual Studio. NET Express beta/visual Studio 2005 under ASP.net 2.0.
First, let's look at what the Web application generally includes. A Web application that typically includes Web pages (. aspx files and HTML files), various types of configuration files (such as web.config), various related resource files, and various source code files that include business core codes, which are typically placed in a virtual directory on the Web server. Since ASP.net is a compiled schema, it also includes all kinds of compiled DLL files, which are placed in the bin directory. For deployment of Web applications, in. NET 2.0, you can use the following methods:
1. Use XCOPY deployment
2. Use Visual Studio's Copy Web site feature deployment
3. Pre-compiling deployment using Visual Studio Precompilation
The following three methods are described separately:
Using XCOPY Deployment
First, we start with Visual Studio Express to create a Web SITE, select vb.net or C #, and then build an application called deployment. In this application, because our goal is to focus on the installation of deployment, so you can arbitrarily pull a button, and then in this button onclick event, write some screen output such as the statement on it.
After compiling the program, we started using Xcopy to deploy the application. Xcopy is the easiest way for. NET to deploy the application. Xcopy simply copies all the files of your Web application to the destination server's specified path, for example, using the following commands:
xcopy D:\intetpub\wwwroot\myprojects\developer\deployment c:\temp/e/k/r/o/h/I
After execution, the result is the following figure, which copies all the files of the current application deployment to the TEMP directory in C disk, then creates the virtual directory in IIS, and points to the directory. For instructions on how to use Xcopy, please refer to the specific instructions for help.
Deploy using the Copy Web site feature of Visual Studio
The Copy Web site feature of Visual Studio allows us to easily deploy and install Web applications. With this feature, you can copy a Web project to the same server or to another server, or to FTP. But note that when you use this feature, you simply copy the file to the destination path and do not perform any compile operations.
In Visual Studio Express, when you select Copy Web site from the Web-site menu, the following dialog box appears: