【问题标题】:Error when deploying web project with msbuild via Teamcity (msdeploypublish)通过 Teamcity 使用 msbuild 部署 Web 项目时出错 (msdeploypublish)
【发布时间】:2013-11-26 14:53:26
【问题描述】:

我在 Teamcity 的构建配置中的 vsproject 上有这个标准的 msbuild 部署方法

/P:DeployIisAppPath=%env.IISSiteName%
/P:Configuration=%env.configuration%
/P:DeployOnBuild=True
/P:DeployTarget=MSDeployPublish
/P:MsDeployServiceUrl=https://%env.TargetServer%/MsDeploy.axd
/P:AllowUntrustedCertificate=True
/P:MSDeployPublishMethod=Wmsvc
/P:CreatePackageOnPublish=True
/P:UserName=%env.domainUser%
/P:Password=%env.domainPassword%

当目标服务器有点忙(被另一个进程错误使用)时,这偶尔会失败:

[VSMSDeploy] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4377, 5): Web deployment task failed. ((26.11.2013 11:55:54) An error occurred when the request was processed on the remote computer.)

(26.11.2013 11:55:54) An error occurred when the request was processed on the remote computer.
An error was encountered when processing operation 'Create File' on 'PersonInfo.ascx'.
The error code was 0x80070020.
The process cannot access 'C:\*****\PersonInfo.ascx' because it is being used by another process.

当我在“办公时间”(0800-1600) 部署时,此错误更频繁。

我可以做些什么来确保此部署不会失败?

【问题讨论】:

    标签: msbuild teamcity msdeploy webdeploy


    【解决方案1】:

    当我过去遇到这种情况时,这是因为 IIS 对文件进行了锁定,并且此时无法覆盖。您可以采用两种方式,您可以在部署之前发布 app_offline.htm 文件。这应该会导致整个应用程序域被卸载。或者,停止应用程序池,部署应用程序,然后重新启动它。

    至于如何从 TeamCity 进行操作,这可能有点棘手。但是,如果您可以使用 msdeploy.exe,您可以使用该命令发布带有simple command 的 app_offline.htm。或者,如果您想使应用程序池离线,recycleApp provider 应该可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-30
      • 1970-01-01
      • 2011-12-10
      • 1970-01-01
      相关资源
      最近更新 更多