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

1

9

On the remote web server I have installed the remote service http://x.x.x.x/MsDeployAgentService.

If I use the Web Application Project's Publish command in VS2010 I can successfully publish to this remote web server and update a specific IIS website.

What I want to do now is execute this capability from the command line.

I am guessing it is two steps. First build the web application project using the relevant build configuration:

msbuild "C:\MyApplication\MyWebApplication.csproj" 
        /T:Package /P:Configuration=Release

Then issue the MsDeploy command to have it publish/sync with the remove IIS server:

msdeploy -verb:sync  
         -source:package="C:\MyApplication\obj\Release\Package\MyWebApplication.zip" 
         -dest:contentPath="My Production Website",
          computerName=http://x.x.x.x/MsDeployAgentService,
          username=adminuser,password=adminpassword

Unfortunately I get an the error:

Error: (10/05/2010 3:52:02 PM) An error occurred when the request was processed on the remote computer.

Error: Source (sitemanifest) and destination (contentPath) are not compatible for the given operation. Error count: 1.

I have tried a number of different combinations for destination provider but no joy :(

Has anyone managed to replicate VS2010 Web Application Project "One Click" Publish from the command line?

Resolved answered 10/5, 2010 at 6:49 Comment(1)
Update: Made a little progress, the command: msdeploy -verb:sync -source:manifest="C:\MyApplication\obj\Release\Package\MyWebApplication.SourceManifest.xml" -dest:auto,computername=x.x.x.x,userName=admin,password=xyz will connect but fails with error... An error occurred when the request was processed on the remote computer. Error: A value for the 'setAclUser' setting must be specified when the 'setAcl' provider is used with a physical path. hmmmm, any ideas?Resolved
T
1

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.

Thimblerig answered 28/10, 2010 at 1:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.