How do I use VS2010 One-Click Publish (MsDeploy) to deploy remotely from the command line? How do I use VS2010 One-Click Publish (MsDeploy) to deploy remotely from the command line? asp.net asp.net

How do I use VS2010 One-Click Publish (MsDeploy) to deploy remotely from the command line?


What you want to do is run the [project name].deploy.cmd file in the /obj/release/package folder instead.

Firstly, in Visual Studio, go to the project properties page then down to the "Package/Publish Web" setting, choose your "Release" configuration then define your content path in the "IIS Web site/application name" setting.

Now run exactly the same MSBuild script you're already using and it will create the package with the content path defined in the /obj/release/package/[project name].SetParameters.xml file.

Final step is just to run [project name].deploy.cmd /Y /M:http://x.x.x.x/MsDeployAgentService in the /obj/release/package folder.

This invokes MSDeploy with all the appropriate parameters.