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会被支持多久,但它确实帮助我个人解决了这个问题.

相关文章

vue阻止冒泡事件 阻止点击事件的执行 <div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些