确定构建代码并在详细构建过程中通过清理它的上下文菜单上的发布选项从VS中提取命令详细信息,解压缩命令我将命令发送到我的构建服务器,这恰好是同一个框作为我的测试网箱,并改变了路径。
来自Team服务的MSBuild正在使用args“/ p:DeployOnBuild = true; PublishProfile = Test; DeployTarget = package”运行,因此它为每个Web应用程序吐出一个包。
这与VS的方式略有不同,这意味着我必须调整源参数,以便从命令行运行以下命令(添加格式以帮助提高可读性)...
C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe
-source:package='..\API.zip'
-dest:auto,ComputerName='https://localhost/MSDEPLOYAGENTSERVICE',UserName='MSDeployUser',Password='********',AuthType='NTLM',IncludeAcls='False'
-setParam:name='IIS Web Application Name',value='Api\MyApp'
-verb:sync
-retryAttempts=2
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
......这让我得到了以下回应......
Info: Using ID '6f5795f6-79bf-49cd-ac27-cc320e3af063' for connections to the rem
ote server.
Error: Could not complete the request to remote agent URL 'https://localhost/MSD
EPLOYAGENTSERVICE'.
Error: The underlying connection was closed: An unexpected error occurred on a s
end.
Error: Unable to read data from the transport connection: An existing connection
was forcibly closed by the remote host.
Error: An existing connection was forcibly closed by the remote host
Error count: 1.
...将“localhost”替换为指向服务器的域名(我用来远程访问该框的域名)导致...
Info: Using ID 'b4820db6-a975-4a77-96f1-51390bcced37' for connections to the rem
ote server.
Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the remote computer ("<my domain>"). On the remote computer, make sure that Web Deploy is installed and that t
he required process ("Web Deployment Agent Service") is started. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.
...奇怪,因为我可以远程访问域上的计算机,但由于某些原因我无法与MSDeploy通信,即使我从本地计算机明确地与它进行对话,它似乎也不是高兴。
我在这里缺少一些巫术吗?
答案 0 :(得分:3)
Deploying web packages with MSDEPLOY
根据这里的答案......是的,这太愚蠢了,甚至都不好笑。
除了查找iis express实例的/ L参数外,MSDeploy似乎无法部署到本地计算机。
答案 1 :(得分:-1)
将您的计算机名称更改为&#34; localhost&#34;。