Azure Web App 部署:Web 部署无法修改目标上的文件,因为它被外部进程锁定 [英] Azure Web App deploy: Web Deploy cannot modify the file on the destination because it is locked by an external process

查看:23
本文介绍了Azure Web App 部署:Web 部署无法修改目标上的文件,因为它被外部进程锁定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 VSTS 中的Azure Web 应用部署"构建步骤将 ASP.NET Core API 发布到 Azure Web 应用:

有时,此步骤会因以下错误而中断:

<块引用>

[错误]Microsoft.Web.Deployment.DeploymentDetailedClientServerException:Web 部署无法修改文件MyProject.Api.exe"目标,因为它被外部进程锁定.为了允许发布操作成功,您可能需要重新启动你的应用释放锁,或者使用AppOffline规则.Net 应用程序在您下一次发布尝试时的处理程序.学习更多在:

I am using the "Azure Web App Deployment" build step in VSTS to publish an ASP.NET Core API to an Azure Web App:

Occasionally, this step breaks with the following error:

[error]Microsoft.Web.Deployment.DeploymentDetailedClientServerException: Web Deploy cannot modify the file 'MyProject.Api.exe' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.

This GitHub issue raises the same issue, but there is no suggested solution using the Azure Web App Deployment build step.

解决方案

As per a separate thread in the Microsoft Github repo here, there's a hacky workaround where if you add the following key to the Azure Appsettings, it can help resolve the locked file deployment error:

MSDEPLOY_RENAME_LOCKED_FILES = 1

I'm not sure how long this appsetting hack will be supported, but it did help solve the issue for me personally.

这篇关于Azure Web App 部署:Web 部署无法修改目标上的文件,因为它被外部进程锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆