Error: ERROR_FILE_IN_USE when Deploying to IIS Server from Azure Pipeline

476 Views Asked by At

I am encountering an issue when attempting to deploy my application to an IIS server from an Azure Pipeline. The error message I'm receiving is as follows:

Error Code: ERROR_FILE_IN_USE More Information: Web Deploy cannot modify the file 'file.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.

enter image description here

I have tried several solutions to resolve this error, but none of them have worked so far. Here are the steps I've taken:

1)Enabled the "Take App Offline" option.
2)Attempted to stop the application deployment and then start the application.
3)Tried copying the files to the destination .
4)Deleted the web.config file from the source and then attempted to deploy.
5)Increased the retry count for the Deploy task.
6)Add these lines in csproj of project :

< EnableMSDeployAppOffline >true< /EnableMSDeployAppOffline >
< GenerateResourceNeverLockTypeAssemblies >true< /GenerateResourceNeverLockTypeAssemblies>

Despite trying these solutions, I continue to encounter the same "ERROR_FILE_IN_USE" error. Can anyone suggest a solution or provide guidance on how to resolve this issue? Thank you!

0

There are 0 best solutions below