【发布时间】:2021-04-02 14:47:09
【问题描述】:
当我尝试在 Azure Devops 中使用发布管道进行部署时,我遇到了锁定 DLL 文件的问题。
报错截图为:
输出为文本:
2021-03-31T17:43:18.2626492Z ##[error]Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'Microsoft.Data.SqlClient.SNI.x64.dll' 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.
Error count: 1.
问题似乎是由错误处理的 .NET 资源引起的。 (例如:非托管 SqlConnection) 反正我也改不了源代码。
这是我的发布管道。
这是我的问题:
Q1)我正在尝试使用此处所述的“-RenameFilesFlag”(MSDEPLOY_RENAME_LOCKED_FILES):
web.config file locked during Azure App Service Deploy task
我如何指定这个参数? 我必须填写“附加参数”文本框吗?我尝试了不同的价值观,但我总是得到一个 “无法识别的参数”错误。
Q2) 如果“-RenameFilesFlag”不适用于此任务。 我可以使用“使应用脱机”来解锁文件吗?
Q3)在 StackOverflow 上的另一篇文章中,我看到了一个特定于“重命名锁定文件”的复选框选项 Getting ERROR_FILE_IN_USE while using Web Deploy in Azure App Service Task v3
我的任务中没有这个选项。我是否有可能混淆了两种类型的 Deploy 任务?
【问题讨论】:
标签: azure azure-devops azure-pipelines-release-pipeline locked-files