Resolving 'File in Use' Error During IIS Deployment in Azure DevOps

190 views Asked by At

When I attempt to deploy to IIS, I consistently encounter a 'file in use' error. I've tried using IIS Manage and Deploy tasks, Copy Files tasks, as well as deleting the 'web.config' file before deployment, but I still face the same issue after some time.

Is there a script or method I can utilize to copy files or deploy to IIS without encountering this error?

1

There are 1 answers

6
Bright Ran-MSFT On

You can try the following ways to resolve this issue:

  1. Directly restart the app pool (the target deployment machine). This will kill the process which is using the affected file.

  2. Enable Application Offline for your app.