微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Azure Web App部署:Web Deploy无法修改目标上的文件,因为它已被外部进程锁定

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

有时,此步骤会出现以下错误

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

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

解决方法

根据Microsoft Github repo here中的一个单独的线程,有一个hacky解决方法,如果您将以下密钥添加到Azure Appsettings,它可以帮助解决锁定的文件部署错误
MSDEPLOY_RENAME_LOCKED_FILES = 1

我不确定这个appsetting hack会被支持多久,但它确实帮助我个人解决了这个问题.

原文地址:https://www.jb51.cc/html/227234.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐