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

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

问题描述

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

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:

[错误] Microsoft.Web.Deployment.DeploymentDetailedClientServerException: Web Deploy无法修改文件"MyProject.Api.exe" 目的地,因为它已被外部进程锁定.为了 允许发布操作成功,您可能需要重新启动 您的应用程序以释放锁定,或使用AppOffline规则 下一次发布尝试时,.Net应用程序的处理程序.学 更多内容: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.

[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.

此GitHub问题提出了相同的问题,但是没有建议的解决方案使用Azure Web App部署构建步骤.

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

推荐答案

根据Microsoft Github存储库中的单独线程

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 Deploy无法修改目标上的文件,因为它已被外部进程锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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