I have been developing a strategy for deploying an ASP.Net Web Application (Visual Studio 2008, .NET 3.5) to staging servers, and to production. In the process, I have encountered 3 products from Microsoft that almost sound synonymous to the untrained ear, but are very different and are designed for completely different purposes. I wish that this post would have been written by Microsoft to emphasize the differences and pros/cons from their perspective.
But after spending some time researching and playing around with each, here is my summary:
Web Setup Projects
- Builds an MSI (installer) that will install and setup a web application on an IIS server.
- Included in Visual Studio 2008 out of the box.
- Accessed by: File > New Project, select “Other Project Types” > “Setup and Deployment” on the left side, then select “Web Setup Project” on the right side.
Web Deployment Projects
- Uses MS Build scripts to pre-compile and prepare a web application for deployment.
- Visual Studio “add-in” released by Microsoft.
- Downloaded free at: http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en
- Accessed by: (after installing add-in) Right-click the web application project node and select “Add Web Deployment project…”
- Lets you specify different “build configurations” (besides Debug and Release) that enable you to have web.config replacement for your different builds.
- Pre-compiles aspx pages with two choices, allowing the .aspx (not the code behind) to be modified on the server, or even compiling in the data from the .aspx files. In the second case, a “dummy” file is created with the aspx filename, but it is essentially blank–everything gets put into the dll.
- Merges multiple dll’s into a single one for easier deployment.
- Written by the IIS team.
- Enables easy syncing of content and configuration settings between IIS servers.
- Installed as an addition to the IIS Manager on either the source or destination server.
- Easy to package up an existing virtual directory/application with all its content, settings, dependencies, etc.
- Easy to push out this package to many servers in a farm to have identical web sites.
My understanding is that Visual Studio 2010 is much more prepared to interact directly with MSDeploy than Visual Studio 2008 is (though I haven’t tried these features out there yet). It seems they have taken many of the concepts of “Web Deployment Projects” and built them in standard to VS 2010, and used that type of methodology to produce the packages for MS Deploy.