加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

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

发布时间:2020-12-14 16:37:06 所属栏目:资源 来源:网络整理
导读:我正在使用VSTS中的“Azure Web App部署”构建步骤将ASP.NET Core API发布到Azure Web App: 有时,此步骤会出现以下错误: [error]Microsoft.Web.Deployment.DeploymentDetailedClientServerException: Web Deploy cannot modify the file ‘MyProject.Api.e
我正在使用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会被支持多久,但它确实帮助我个人解决了这个问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读