0
votes

I'm looking for a way to run a WebDeploy call from within my MsBuild target, with the WebDeploy call having nothing to do with the application being built.

I have a commandline msdeploy which looks like this:

msdeploy.exe –verb:sync 
    -source:contentPath="C:\MyFolderPath" 
    -dest:contentPath="C:\MyDestinationPath"

This works perfectly. Now I want to plug this into an msbuild file into the AfterBuild target:

<MSDeploy Verb="Sync"
  Source="-contentPath:'C:\MyFolderPath'"
  Destination="-contentPath:'C:\MyDestinationPath'" />

This gives me ERROR_PROVIDER_NOT_FOUND when I build. I've tried the -contentPath both with and without the -

I can't seem to find the documentation for the MsDeploy task though which isn't helping. Any help much appreciated

1

1 Answers

0
votes

Delete the dashes ("-") in the Source and Destination attributes. You may also need to use escaped double quotes instead of single quotes but you can try it both ways:

<MSDeploy      
  Verb="sync"
  Source="dirPath=%22$(FilesToPackageFolder)%22"
  Destination="package=%22%(DeployTypes.DeployPackagePath)%22"
  />