问题
I received this error when trying to run a build from within VS2010.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (3588): Web deployment task failed.(Could not complete the request to remote agent URL 'https://http//[serverName]:8172/msdeploy.axd?site=Default Web Site'.) Could not complete the request to remote agent URL 'https://http//[serverName]:8172/msdeploy.axd?site=Default Web Site'. The remote name could not be resolved: 'http'
I'm not sure why it says "https://http//..."
The code is checked in to a remote TFS server. I created a Build Definition from within VS Team Explorer and that is the error I get when trying to build/publish the project. The [servername] above is the IIS server to where my project is to be published.
These are the MSBuild Arguments:
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=False
/p:MSDeployPublishMethod=WMSVC
/p:MSDeployServiceUrl=http://[serverName]
/p:DeployIisAppPath="Default Web Site/[site/app Name]"
Anyone come across the same error?
btw, I was able to do a successful Web Deploy from within VS Publish itself
回答1:
Edward solved the first part of your problem.
Regarding the https:// part, msdeploy defaults to doing things in a secure manner. To turn this off you have to use the -allowUntrusted command.
for "light" reading: http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx
and
http://forums.iis.net/t/1158582.aspx
回答2:
I'm pretty sure that you either need to specify just a hostname to the MSDeployServerUrl
option, or a full URL to msdeploy. That is, either:
/p:MSDeployServiceUrl=http://[servername]:8172/msdeploy.axd
or:
/p:MSDeployServiceUrl=[servername]
The latter will be translated to https://[servername]:8172/msdeploy.axd
.
回答3:
It's been a while since the question being opened, but I came across same problem and it wasn't fully resolved with answers above...
What I needed to change was removing protocol from MSDeployServiceUrl
/p:MSDeployServiceUrl=[servername]
AND changing MSDeployPublishMethod to RemoteAgent
/p:MSDeployPublishMethod=RemoteAgent
Hope this will be useful for others.
回答4:
I created a Publish Profile using web deploy and saved in TFS and then in my build definition in MSBuild Arguments I added this:
/p:DeployOnBuild=True;PublishProfile=Web_Dev_WebDeployProfile /p:AllowUntrustedCertificate=True /p:username=myusername /p:Password=mypassword
It worked for me. I also make sure that my build has permission to the published folder (virtual directory)
I also make sure that Web Management Service and Web Deployment Agent Service are running on my web server.
来源:https://stackoverflow.com/questions/7676840/vs2010-tfs-build-failure-could-not-complete-the-request-to-remote-agent