While creating deployment project for my solution strange behavior have been noticed. I'm using webdeploy for deployment of my web apps. And when putting this
<Exec Command="$(MsBuildBinPath)\msbuild.exe $(SourceControlPath)\...\myproject.csproj /p:configuration=Release /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MSDeployServiceUrl=https://x.x.x.x:8172/msdeploy.axd /p:MSDeployPublishMethod=WMSvc /p:DeployIisAppPath="Default Web Site" /p:username=username /p:password=password /p:AllowUntrustedCertificate=True /P:CreatePackageOnPublish=True">
</Exec>
in my deploy project file, it builds and deploys my application without issues.
But using MSBuild task with exact same set of properties
<MSBuild Properties="Configuration=$(Configuration);DeployOnBuild=True;
DeployTarget=MSDeployPublish;MSDeployServiceUrl=https://x.x.x.x:8172/msdeploy.axd;
MSDeployPublishMethod=WMSvc;DeployIisAppPath="Default Web Site";
UserName=username;Password=password;
AllowUntrustedCertificate=True;CreatePackageOnPublish=True"
Projects="$(SourceControlPath)\...\myproject.csproj"
></MSBuild>
gives me an error: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.5\Web\Microsoft.Web.Publishing.targets(4196, 5): error ERROR_COULD_NOT_CONNECT_TO_REMOTESVC: Web deployment task failed. (Could not connect to the remote computer ("x.x.x.x") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer...
So, I was thinking that basically both approaches do the same. what's wrong with 2-nd approach?