麻烦发布网站 TFS 2013

trouble publishing website TFS 2013

我有一个 TFS 2013 版本,我正试图将其发布到构建服务器上的文件夹中。我已经安装了 WebDeploy,但我总是收到错误消息:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets (4274): Web deployment task failed. (Could not connect to the remote computer ("localhost"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)

我已经在构建服务器上建立了一个网站,这就是我尝试发布该网站的地方。实际上我什至不关心发布它本身——我只需要我的构建输出自动转到本地文件夹。现在我们必须手动打开解决方案并选择发布...以获取后续 InstallShield 构建需要输入的输出。这是我的 MSBuild 参数。有谁知道可能遗漏了什么?

/p:SrcDir=C:\Builds\TFS\WebApps\Src
/p:RevKeyname=WebAppsRevNr 
/p:DeployOnBuild=true 
/p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://127.0.0.1:8172/msdeploy.axd 
/p:CreatePackageOnPublish=True  
/p:DeployIisAppPath="WebApp" 
/p:MsDeployPublishMethod=WMSVC 
/p:AllowUntrustedCertificate=True
/p:AutoParameterizationWebConfigConnectionStrings=False 
/p:Authtype=NTLM /p:username=""

我已经检查了 net start wmsvc 和 net start msdepsvc,两者都是 运行ning。有什么想法吗?

谢谢!

更新 我已经尝试了 Andy 建议的所有内容,现在当我从命令行 运行 执行此操作时,我收到了这个奇怪的错误消息:

"C:\Workspace\VS2013\WebApps\Main\Src\webapps.sln" (default target) (1) ->
 "C:\Workspace\VS2013\WebApps\Main\Src\CoreWebApps\CoreWebApps.csproj" 
 (default
target) (7) ->
(AutoParameterizationWebConfigConnectionStringsCore target) ->
  C:\Program Files 
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web
.Publishing.targets(2295,5): error : Could not open Source file: Could not 
find
 a part of the path 
'C:\Workspace\VS2013\WebApps\Main\Src\CoreWebApps\Areas\Adm
in\Views\Web.config;Areas\Admin\Views\Web.config'. 
[C:\Workspace\VS2013\WebApps
\Main\Src\CoreWebApps\CoreWebApps.csproj] 

知道它为什么要寻找 Web.config;Areas\Admin\Views\Web.config'. 吗?这是没有意义的。

请尝试以下项目以缩小问题范围:

  • 尝试使用 IP机器名 而不是 "localhost"
  • 登录你的构建代理机器,然后手动执行相同的 相同参数中的 MSBuild 命令(您在构建中提供的 定义)来构建和部署您的解决方案,然后检查结果。你 需要确保您可以在其中手动 运行 相同的 MSBuild 命令 部署参数以成功构建和部署您的解决方案 构建代理机器。然后在 TFS Build 中使用相同的部署参数 定义。
  • 仔细检查 Web 部署设置以确保 网站与 IIS 中的网站完全相同。
  • Web 之前安装 Web 管理工具 部署 : 安装 Web 管理服务(角色 -> Web 服务器 > 管理工具 > 管理服务)。然后卸载 Web Deploy,然后重新安装 Web Deploy

您还可以参考 this thread 进行问题排查。


更新:

对于“无法打开源文件:无法找到路径的一部分”的问题,您可以参考以下类似文章进行故障排除。