VS2010 TFS构建失败 - 无法完成对远程代理的请求

时间:2011-10-06 15:41:40

标签: visual-studio-2010 iis tfs tfs2010 iis-7.5

尝试从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'

我不确定为什么会说“https:// http // ...” 代码签入远程TFS服务器。我在VS Team Explorer中创建了一个Build Definition,这是我在尝试构建/发布项目时遇到的错误。上面的[servername]是我的项目发布的IIS服务器。

这些是MSBuild参数:

/p:DeployOnBuild=True 
/p:DeployTarget=MsDeployPublish 
/p:CreatePackageOnPublish=False 
/p:MSDeployPublishMethod=WMSVC 
/p:MSDeployServiceUrl=http://[serverName] 
/p:DeployIisAppPath="Default Web Site/[site/app Name]"

有人遇到同样的错误吗? 顺便说一句,我能够在VS Publish内部成功完成Web部署

4 个答案:

答案 0 :(得分:6)

爱德华解决了问题的第一部分。

关于https://部分,msdeploy默认以安全的方式执行操作。要关闭它,您必须使用-allowUntrusted命令。

用于“轻”阅读: http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx

http://forums.iis.net/t/1158582.aspx

答案 1 :(得分:4)

我非常确定您需要为MSDeployServerUrl选项指定主机名,或者指定msdeploy的完整URL。也就是说:

/p:MSDeployServiceUrl=http://[servername]:8172/msdeploy.axd

或:

/p:MSDeployServiceUrl=[servername]

后者将被翻译为https://[servername]:8172/msdeploy.axd

答案 2 :(得分:0)

自打开问题以来已经有一段时间了,但我遇到了同样的问题而且上面的答案还没有完全解决......

我需要更改的是从MSDeployServiceUrl中删除协议

/p:MSDeployServiceUrl=[servername]

将MSDeployPublishMethod更改为RemoteAgent

/p:MSDeployPublishMethod=RemoteAgent

希望这对其他人有用。

答案 3 :(得分:0)

我使用Web部署创建了一个发布配置文件并保存在TFS中,然后在MSBuild Arguments中的构建定义中添加了这个:

/p:DeployOnBuild=True;PublishProfile=Web_Dev_WebDeployProfile  /p:AllowUntrustedCertificate=True /p:username=myusername /p:Password=mypassword

它对我有用。我还确保我的构建对已发布的文件夹(虚拟目录)具有权限

我还确保在我的网络服务器上运行 Web管理服务 Web部署代理服务

相关问题