Monday, December 31, 2007

Deploying ASP.NET Web application using web deployment project

Its known from many posts in most of the blogs that use of web deployment project in a solution is a better option than opting for XCOPY or copy project.

This post explains my experience using the web deployment project for one of my web application.

Creating a Web Setup Project: Using Visual Studio .NET InstallerWe will start by adding a new Web Setup Project to our deployusingInstaller ASP.NET Web application solution by selecting File->Add Project-> New Project from the menu. In the New Project dialog box, select Setup and Deployment Projects from the Project Types pane and then select Web Setup Project in the Templates pane.


After creating the project, you then need to add the output of the primary assembly and the content files of the ASP.NET Web application to the setup project. To do this, right click on the deployusingInstaller project in the solution explorer and select Add->Project Output from the context menu. In the Add Project Output Group dialog box, select deployusingInstaller from the Project drop down list and select Primary Output from the list.


After adding the project output, you then need to add the related Content Files (such as .aspx files, Images, and so on) to the project. To do this, again bring up the Add Project Output dialog box and then select Content Files from the list this time.

Configuring Properties through the Properties:
There are a number of properties that you can set through the properties window of the Web Setup project. These properties determine the runtime display and behavior of the Windows installer file. To accomplish this, right click on the deployusingInstaller project from the solution explorer and select Properties from the context menu to bring up its properties window.

Installing the ASP.NET Web Application:
Once you have created the Windows installer file (.msi file), then installing the ASP.NET application in the target servers is very straightforward. All you need to do is to double-click on the .msi file from the Windows explorer. This will initiate the setup wizard, which will walk you through the installation steps.


Clicking on Next, results in the following dialog box, where you can specify the virtual directory that will be used to host this Web application. This is one of the handy features wherein the creation of virtual directory is completely automated obviating the need for manual intervention.

In dialog box, you can also click on the Disk Cost... command button to get an idea of the space required for installing this Web application. Clicking on Next in the above dialog box results in the following dialog box where you are asked to confirm the installation.

When you click on Next in the dialog box, the installation will begin and the application will be installed. The application is successfully installed.

After installing the application, you can see the installed ASP.NET application through the Add/Remove Programs option (that can be accessed through Start->Settings->Control Panel) in your computer. From here, you can run the setup program to uninstall the application any time you want to.

No comments: