I'm trying to deploy a package via the MSDeploy task from within MSBuild.
I have configured two Item Groups to represent my source and destination.
The source is a package I have created eg. Solution.zip The destination is IIS 7 on a remote server.
The configuration looks like this :
<ItemGroup>
<DeploySource Include="package">
<Path>$(PackagePath)</Path>
</DeploySource>
</ItemGroup>
<ItemGroup>
<DeployDestination Include="iisApp">
<ComputerName>https://myserver.com/msdeploy.axd</ComputerName>
<UserName>XXXXXXXX</UserName>
<Password>XXXXXXXX</Password>
<AuthType>Basic</AuthType>
<Path>Default Web Site/Umbraco.Web_deploy</Path>
</DeployDestination>
</ItemGroup>
<PropertyGroup>
<ConfigFileName>Staging.config</ConfigFileName>
</PropertyGroup>
I then call the MSDeploy task within MSBuild like this :
<Target Name="Deploy_v2">
<!-- Using ContinueOnError due to a bug in MSDeploy task-->
<MSDeploy
ContinueOnError="true"
ToolPath="C:\Program Files\IIS\Microsoft Web Deploy V3"
Verb="sync"
Source="@(DeploySource)"
Destination="@(DeployDestination)"
AllowUntrusted="true"
Replace="objectName=filepath,match=Configs\$(ConfigFileName),replace=web.config"
/>
</Target>
This results in the following command line execution
C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe -source:package='C:\CLIENTS\DAM\Components\Umbraco\SiteTemplate_v6_1_6\Output\Package\UmbracoTemplate_v6_1_6.zip' -dest:iisApp='Default WebSite/Umbraco.Web_deploy',ComputerName='https://myserver.com/msdeploy.axd',UserName='XXXXXXX',Password='XXXXXXXX',AuthType='Basic' -verb:sync -replace:objectName=filepath,match=Configs\Staging.config,replace=web.config -allowUntrusted
Which unfortunately results in the following error :
MSDEPLOY : Error: Source (dirPath) and destination (iisApp) are not compatible for the given operation.
It seems to me that MSDeploy is viewing my package as a dirPath. When I created the package it did use a dirPath as its source.