我们有一个解决方案,由几个类库和一个 Web 应用程序项目组成。我们使用 TFS 2012 和 Team Build。在构建服务器上,解决方案可以正确编译。
我目前正在尝试通过 MSBuild 参数来完成这个过程。
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=
解决方案可以构建但无法部署,我收到以下错误信息:
msdeploy error ERROR_DESTINATION_INVALID:Web 部署任务失败。(无法连接到远程计算机("https")。确保远程计算机名称正确,并且您能够连接到该计算机。详情请参见:http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_INVALID.) [C:\Builds\1\ProjectName\Solution General Build\Sources\Temp Source\ProjectName\Solution\Project.csproj]
是否还有其他参数需要传递以指定服务器?我没有打算让 https 成为服务器名称...我已经尝试省略了 https:// 返回相同的错误,所以它肯定是从某个地方得到的值。
我尝试了以下 MsDeployServiceUrl 的值:
- https://testWebServer:8172/MsDeploy.axd?site=direct - https://testWebServer:8172/MsDeploy.axd - "https://testWebServer:8172/MsDeploy.axd?site=direct" - https://192.168.X.X:8172/MsDeploy.axd?site=direct - "https://192.168.X.X:8172/MsDeploy.axd?site=direct" - testWebServer:8172/MsDeploy.axd?site=direct
更新
好的,至少以下内容可以连接:
/p:MsDeployServiceUrl=
我目前正在尝试通过 MSBuild 参数来完成这个过程。
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=
https://testWebServer:8172/MsDeploy.axd?site=direct
/p:AllowUntrustedCertificate=True
/p:DeployIisAppPath="direct" /p:AuthType=NTLM解决方案可以构建但无法部署,我收到以下错误信息:
msdeploy error ERROR_DESTINATION_INVALID:Web 部署任务失败。(无法连接到远程计算机("https")。确保远程计算机名称正确,并且您能够连接到该计算机。详情请参见:http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_INVALID.) [C:\Builds\1\ProjectName\Solution General Build\Sources\Temp Source\ProjectName\Solution\Project.csproj]
是否还有其他参数需要传递以指定服务器?我没有打算让 https 成为服务器名称...我已经尝试省略了 https:// 返回相同的错误,所以它肯定是从某个地方得到的值。
我尝试了以下 MsDeployServiceUrl 的值:
- https://testWebServer:8172/MsDeploy.axd?site=direct - https://testWebServer:8172/MsDeploy.axd - "https://testWebServer:8172/MsDeploy.axd?site=direct" - https://192.168.X.X:8172/MsDeploy.axd?site=direct - "https://192.168.X.X:8172/MsDeploy.axd?site=direct" - testWebServer:8172/MsDeploy.axd?site=direct
更新
好的,至少以下内容可以连接:
/p:MsDeployServiceUrl=
testWebServer
我看到了很多关于这个特定参数的帖子,几乎都是 URL,而不仅仅是主机名(那些看起来像主机名的我认为只是为了简洁而写的)。
然而,我现在面临一个新问题。我已经将Build Service Account(域帐户)设置为Web服务器上的本地管理员,并且我收到了msdeploy error ERROR_USER_NOT_ADMIN
以及安全日志中的审核失败。
解决方案
这是我目前使用的MSBuild参数。
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=WMSvc /p:MsDeployServiceUrl="https://SERVER:8172/MsDeploy.axd" /p:AllowUntrustedCertificate=True /p:DeployIisAppPath="siteName"
现在我得到了ERROR_USER_UNAUTHORIZED错误。显然,我要么没有正确设置委派,要么我创建的IIS Manager用户有误。无论如何,如果需要,这将在另一篇文章中讨论。