Web Deployment has taken a huge stride in Visual Studio 2010. I have started a blog series where I have written about web deployment, you can read more about them below:
In VS 10 we use MSDeploy behind the scenes to deploy your entire web application along with all of its dependencies like IIS Settings, DB, web content etc to any destination server.
MSDeploy is a new technology specially designed to serve the purpose of deploying web applications seamlessly across IIS Servers. My hope is to give you a CONCEPTUAL high level overview to understand how web deployment with VS10 & MSDeploy really works.
In case of web deployment or replication across server farms what you really require is to take the web and its dependencies from one box to another. To further over simplify there is a source (your dev box) and there is a destination (your web server), the source needs to be replicated on to the destination and that is what we are trying to achieve (with of course a lot more details behind the scene :-))
MSDeploy uses this simple concept of taking the source and applying it on to the destination. Let us try to understand what all are possible sources:
Source
Destination
Well the concepts of source and destination are pretty simple but the reason why they are so interesting is because when you set up your deployment settings in Visual Studio then VS creates something that we call as Source Manifest and feeds to MSDeploy. Check out the figure below which gives you an idea of how VS 10 will produce your web package:
Source Manifest is a simple XML which instructs MSDeploy on what all Providers to invoke on the source machine. So what is a MSDeploy Provider?
A MSDeploy provider is a simple object which MSDeploy engine invokes to do two major CONCEPTUAL tasks:
e.g. if you had Database attached to your web then at source DB Provider will be called to pull out your data and schema and convert it into SQL Scripts which will then go into the web package.
e.g. if there were SQL scripts in your web package then at destination DB Provider will be called to run the SQL command and the SQL scripts to create and set up the database
MSDeploy comes with a lot of pre-built providers like:
Based on your project settings Visual Studio creates a source manifest which is fed to MSDeploy to create package or deploy your web application. So on the source box below is how MSDeploy works:
Along with creating the source manifest, Visual Studio also creates destination manifest for you. Check the below diagram:
When you are ready to deploy then on the destination you can feed the web package and the destination manifest to MSDeploy to deploy your web site. In the destination manifest you can change the values like “IIS Application Name”, “DB connection strings” etc
This is how you can use web packages on any machine with MSDeploy and by configuring your deployment options in the destination manifest you can go and and easily recreate your webs.
It is not possible for someone to come up with every possible provider that everyone needs so there will be an extensibility model by which you can write your own providers and register it with MSDeploy engine.
Visual Studio is also made extensible to allow you to hook into the packaging and publishing process to call your custom MSDeploy providers in the source manifest.
The most interesting pieces is that with IIS Manager and Visual Studio 2010 UI, you will not really need to know all these details, things will just work but I thought it is often interesting to know how things work behind the scenes.
I hope this conceptual overview helps you get the perspective on how web deployment with VS 2010 and MSDeploy will work!!
Vishal R. Joshi | Program Manager | Visual Studio Web Developer
Web Deployment has taken a huge stride in Visual Studio 2010.   I have started a blog series
Will it be possible to tie into the MSDeploy from MSBuild? It would be very useful to be able to interact with it from the TFS build server, to be able to achieve CI.
Hi;
Very Interesting, can't wait to start playing with VS2010. By the way what app do you use to do your diagrams?
Regards
Shivam
Thank you for submitting this cool story - Trackback from DotNetShoutout
>> Aaron Powell: Will it be possible to tie into the MSDeploy from MSBuild? It would be very useful to be able to interact with it from the TFS build server, to be able to achieve CI.
Vishal: Yes, everything that we built in VS10 Web Deployment feature set is built to support MSBuild, so you will be able to achieve CI using TFS using the feature set. We will eventually publish posts around how to set it up, hopefully should be very simple :-)
>>>Shivam: Very Interesting, can't wait to start playing with VS2010. By the way what app do you use to do your diagrams?
Vishal: Thanks... you can try packaging using Visual Studio 2010 CTP as well; so do try it out if you like... My diagrams are just made using powerpoint and icons picked up from various presentation templates that we use for conferences... :-)
I did a session at DevWeek on ASP.NET 4.0 and Visual Studio 2010 and I’ll be doing a similar session