How to MSDeploy a built website package to a virgin IIS website How to MSDeploy a built website package to a virgin IIS website asp.net asp.net

How to MSDeploy a built website package to a virgin IIS website


MSDeploy has the capability, you just have to hook the right provider.

For example, you are using the "auto" provider in your destination, which basically says the destination is going to be the same as (or compatible with) the source, which you are setting up as a package. Since a package does not specify its hosting environment, msdeploy isn't going to try to do anything with it, it just going to copy files from the package basically.

You are calling auto in (the "-dest: auto"):

-dest:auto,computerName='$(MSDeployComputerName)'

To get msdeploy to create the site, you need to use a more specific provider which understand the concepts of a "site" and an "app" and how they can use the package as the contents of a website element.

I haven't done this in awhile, so I don't want to lay out specifics (as I'll prob steer you wrong), but take a look at the MSDN document on msdeploy providers.

1st look at auto, your current setting. Then take a look at iisApp and appHostconfig.

http://technet.microsoft.com/en-us/library/dd569040(WS.10).aspx

I believe one of those 2 will create the site/app for you if used correctly, and will give you the result you need.


Pretty sure MSDeploy can't do that. One thing I have done in the past is have an Exec task call appcmd.exe to tear down/build up a new web site. The MSBuild Community Tasks have some web site capabilities as well as the MSBuild Extension Pack.