Professional Documents
Culture Documents
Alternatives
When it comes to web applications specifically, then you will encounter many techniques that ca
utilized as a deployment strategy for your web application:
XCOPY Deployment
The most trivial technique is to simply copy your web application files to the production server
drive and set a virtual directory there. The setting of a virtual directory is needed by several
deployment schemes and can be achieved from Internet Information Manager Microsoft Manag
Consol (MMC snap-in). Because developers typically use the command line order 'XCOPY' to
implement this technique, this technique is typically referred to as XCOPY Deployment.
Copy Web Site is a new technique provided in ASP.NET 2.0 and Microsoft Visual Studio 2005
(Available from the Website / Copy Web Site... Menu option). Although this technique is perform
from inside Visual Studio (in contrast with the XCOPY deployment technique which is performed
outside Visual Studio), there is no compilation performed at all. All your pages are still in their s
code form on the production server. Some developers see this fact as a high risk on their intelle
property. Two extra disadvantages of this technique (and in fact any other technique that does
involve any compilation before deployment) are reduced error checking and the slow initial pag
load.
The reduced error checking is a direct result to that no compilation is performed and hence som
errors may be discovered by your users later. The initial page load slowness is also because not
is compiled yet and the entire web application has to be compiled at the time the first page is b
requested. An advantage of this technique over the XCOPY deployment is that you have the op
to deploy to the File System, the Local IIS, the FTP Sites, and the Remote Sites. Please see figu
Figure 1
Pre-compilation
All of the deployment methods we mentioned so far suffer from the fact of that no compilation
performed along with the disadvantages that comes as a direct result from this fact. To ensure
page load and some protection of your source code, you should pre-compile your web site befo
deployment.
Pre-compilation can also be achieved using the command line compiler 'aspnet_compiler'.
Using Microsoft Visual Studio 2005 you can still perform pre-compilation from the 'Build / Publis
Web Site' menu command. Please see figure 2.
Figure 2
SETUP Projects
It's always desirable to package your web applications such that they are easy to deploy on the
production server. Microsoft Visual Studio 2005 gives you this rich packaging option for free ...
follow the following instructions ...
First of all you need to know that our target is to create a package (and MSI file) that contain o
web application in a form that can be later easily deployed on the final production server.
Let's start by selecting 'File / New / Project' in Microsoft Visual Studio 2005. This will present yo
famous set of possible project types from which you will select 'Other Project Types / Setup and
Deployment' then you will select the 'Web Setup Project' icon from the side to the right. See fig
3.
Figure 3
In figure 3, set the appropriate project name and folder options then click OK.
You can always have the same behavior by adding the SETUP project above to your web applica
solution instead of creating a new separate solution. You can achieve this by selecting 'File / Ad
New Project' instead of 'File / New / Project'. This way you will have a self contained web solutio
The 'File / Add / New Project' method is much more recommended.
Figure 5
To tune the properties of our SETUP project, we will need to press F4 while it's name is selected
the solution explore. This will bring the SETUP project's properties window. Several useful prope
can be set in this window:
Property Purpose
Author, Description,
Manufacturer,
Use all of these properties to identify / descr
ManufacturerUrl,
your application and yourself.
ProductName, Subject,
Title, and Version
Here you can specify the icon to be displayed be
AddRemoveProgramsIcon your application in Windows Control Panel's Add R
Programs.
Specify here whether or not a check is to be perf
DetectNewerInstalledVersion to determine the existence of a new version alre
installed of your web application.
Specify here whether you need an older version of
RemovePreviousVersions web application to be removed if a newer version
being installed.
Some web applications requires the Internet
Information Service to be stopped and then resta
RestartWWWService
after the deployment of the application. Use th
property to control such behavior.
The last and most important step is to actually build our SETUP project. This cane be achieved
right clicking the name of our SETUP project in the solution explorer. It's this specific step that
creates the MSI package / file mentioned above. This is the file you will need to distribute to yo
users and this is the file they will use to deploy the web application on their production server.
It's worth mentioning that the actual deployment process will be some what similar to the SETU
any typical desktop application (with some exceptions of course). One of the many similarities i
the web application after deployment will automatically appear in the 'Add / Remove Programs'
window of Windows Control Panel.
For your users to deploy your web application they will just need to double click the MSI file. Th
produce something similar to figure 6:
Figure 6
For further information
Related articles:
1. Validating User Input In ASP.NET 2.0 Web Applications
2. Dynamic User Interface in ASP.NET Web Applications
3. Multithreading in ASP.NET
4. Build Notepad ASP.NET Web Application - part 2 of 2
5. Build Notepad ASP.NET Web Application
6. .NET Framework Assemblies
7. Introduction to Visual Web Developer 2005 - Express Edition
8. Classic ASP vs. ASP.NET
9. How To Deploy .NET Windows Application