Web Deployment with VS 2010 and IIS

Web Deployment with VS 2010 and IIS

Rate This
  • Comments 31

Today, deploying a web application is not as easy as it should be. Whether you are deploying your web to a shared hosting environment and paying monthly to maintain it OR whether you have a web server/s managed by your enterprise, there are a lot of manual steps involved in getting your application from point A to point B.

If you are deploying your web application to a shared hoster then today you have to use technologies like FTP which take a long time to get your web content to the hosted server. After deploying your content you have to manually go to hoster control panel and install your database by running sql scripts and configure various IIS settings like marking a folder as an application to isolate it from the rest of the application.

If you are in an enterprise environment and you want to get a web application deployed you have to systematically document each step that your server admins and DBAs have to perform. In most circumstances you also have to ask your admins to modify the web.config files and go to IIS Manager and configure your settings apart from deploying your web content. Your DBA has to do the necessary steps of running the sql scripts in the right order to get your DB up and running. Such installations many a times take hours to complete.

With Visual Studio 2010 and IIS Web Deployment Tool (MsDeploy.exe) we are introducing a set of technologies which can seamlessly deploy your applications taking care of the problems stated above. Microsoft Web Deployment Tool is a free download available on the web (currently in Beta2). You can download MSDeploy from below location:

http://blogs.iis.net/msdeploy/archive/2008/10/29/the-web-deployment-tool-beta-2-is-now-available.aspx

Do note that installing Visual Studio 2010 will automatically install MSDeploy for you. Visual Studio 2010 CTP can be downloaded from below location:

http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&displaylang=en

Web Deployment feature sets in VS 2010 can be broken down into following major areas:

1. Web Packaging - VS 2010 uses MSDeploy to create a .zip file for your application which we call as a web package. This file contains meta data + the below artifacts

· All of your IIS Settings (e.g. application pools, error pages etc)

· Web Content (e.g. .aspx, .ascx, .js, images etc)

· SQL Server DB

· Various other artifacts like Security Certs, GAC Components, Registry etc

A web package can then be taken to any server and installed either via IIS Manager UI Wizard or even via command line or API for automated deployment scenarios.

2. Web.Config Transformation – With VS 2010 web deployment we are introducing XML Document Transform (XDT) which will allow you to transform your development time web.config file to production/deployment time web.config file. The transformation is controlled by web.config TRANSFORM files named web.debug.config, web.release.config etc. The naming of these files is tied to the MSBuild configuration you are trying to deploy. The transform file will need just the changes that you really want to make to your deployed web.config… You can control the type of changes by instructing the XDT engine using simple and easy to understand syntax…

e.g. the below syntax in web.release.config will replace the connectionString section with new values in the web.config file which is produced for deployment of your release configuration.

clip_image002

3. DB Deployment – VS 2010 allows you to deploy your application along with all of its dependencies including database dependencies on SQL Server. Just by providing the connection string of your source database VS10 will automatically script its data/schema and package it for deployment. VS will also allow you to provide custom .sql scripts and also sequence them correctly to run on the server. Once your DB is packaged along with your IIS Settings and web content you can choose to deploy it to any server by providing the connection string at the install time.

4. 1-Click Publish - VS 2010 will allow you to not only package your web applications with all of its dependencies but also use IIS remote management service to publish the application to remote server. VS 10 will now allow you to create a publish profile of your hoster account or of various testing servers and save your credentials securely so that going forward you can deploy to any of these publish profiles with just one click using Web One Click toolbar. With VS 10 you will also be able to publish using MsBuild command line so that you can configure your team build environment to include publishing in continuous integration model.

To learn in further details about these technologies please view the videos here.

Vishal R. Joshi | Program Manager | Visual Studio Web Developer

Leave a Comment
  • Please add 4 and 7 and type the answer here:
  • Post
  • This looks great.  I noticed that you tagged the post with Web Application Projects...are these scenarios supported in a Web Site project?  And will this work with Web Deployment projects (aspnet_merge)?

  • Currently these scenarios are supported only in Web Application Projects (WAPs)... We are considering web site related and pre compile related scenarios in the future...

  • Today, deploying a web application is not as easy as it should be. Whether you are deploying your web

  • I think you are missing the point with the SQL scripts. I believe this is a problem where Microsoft has no understanding of how best to deal with databases and versioning, since there is no documentation or blogposts from microsoft on this subject at all. The situation is like it was with ASP.NET webforms, which is since remedied by the ASP.NET MVC project. I believe you should consider hiring outsiders to get the right knwoledge in-house.

    Here's the deal: database migrations. I use a framework called migrator.net and it has taken all the pain out of database deployment. Forget about scripts, even better, forget about SQL Server only deployment. You know there are other databases out there right? With a good migrations framework, you can support all databases, and do in place updates, rollbacks etc in the deployment.

    I sincerely hope you will do the proper research on this subject and hopefully implement at least a few hooks where we can integrate migrations into the deployment. Otherwise, you might as well not market the database capabilities for msdeploy, because they are next to useless for many 'modern' agile teams.

    Thanks for considering!

  • Thank you for submitting this cool story - Trackback from DotNetShoutout

  • After a long way of development Microsoft will introduce a new tool for deploying web applications with Visual Studio 2010. The tool is called "MSDeploy". Especially interesting is the new possibility to replace specific parts of a web.config by depl

  • Please consider ASP.NET MVC web applications when you develop/test/dog food this _most needed_ tool! please :)

  • I saw this posting on the webdevtools blog and was intrigued by its promise. Deploying apps across multiple

  • You've been kicked (a good thing) - Trackback from DotNetKicks.com

  • We briefly mentioned that Visual Studio 2010 is integrating the Web Deployment Tool, but we didn't really

  • This does sound promising and may help with deployment of my web app. I'll throw out a scenario for you to consider given the rapid move to SAAS type applications. One development environment but multiple client sites. I typically have to deploy the same code to 20 or 30 sites at a time. Each site with it's own configuration files. This is now currently deployed to each of the dedicated servers and then with RDP, a script is written to copy into each root.

    Your thoughts?

  • >> PK  Please consider ASP.NET MVC web applications when you develop/test/dog food this _most needed_ tool! please :)

    PK, ASP.NET MVC web application will be supported as part of this story...

    -Vishal

  • >>>Clyde: I typically have to deploy the same code to 20 or 30 sites at a time. Each site with it's own configuration files. This is now currently deployed to each of the dedicated servers and then with RDP, a script is written to copy into each root.

    Clyde, you scenario will be supported by the model... We will allow you to publish same code to 20-30 different sites easily...  I will keep the suspense till the subsequent post but you will not have to do all the manual work that you are doing today...  Just to set expectations though, you might have to do a tiny bit of customization...

    -Vishal

  • >> Joel:I saw this posting on the webdevtools blog and was intrigued by its promise....

    Joel:  Our goal is to pleasantly surprise you with these set of technologies... :-)  We have tried to hit 80% scenarios and recognize that there might be areas which will need work but I am sure we will get there...  We will love to hear your feedback to make that happen…

    -Vishal

  • >>>Mike: Database Migration Plans

    Mike,  we certainly have considered DB Migrations seriously as it was asked by various customers and although it is not supported out of the box currently it is certainly on our radar...  You might wonder there are so many frameworks out there, why can't MS do something like that, how difficult can that be...? Believe me we did put some thought in that area too... Again it is not coz we did not want to do it but due to various longer term considerations around doing it right...

    But in the meantime we will be providing enough extensibility hooks that you can hook in your custom DB migration into the above deployment story with VS10 and MSDeploy...

    Again feel free to send me an email at Vishal.Joshi@microsoft.com or even call me @ 425-705-2031 and I will be happy to discuss...

    Hope this helps...

    -Vishal

Page 1 of 3 (31 items) 123