We have been using MSDeploy for deploying to one of our webn sites for quite some time with no isues. All dlls were managed. Recently we had to add a native dll to the deployment package. Now every time we deploy we get the following error:
An error occurred when the request was processed on the remote computer. An error was encountered when processing 'file.dll'. The error code was 0x80070020. The process cannot access 'file.dll' because it is being used by another process.
Hi, try ProcessMonitor ([url=http://technet.microsoft.com/en-us/sysinternals/bb896645]http://technet.microsoft.com/en-us/sysinternals/bb896645[/url] to know which process is using 'file.dll'.
This message is provided "AS IS" with no warranties, and confers no rights!
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
You can choose to ignore that particular error and basically just skip that file by adding a provider setting filePath.ignoreErrors=0x80070020 on your sync - basically this provider setting format (provider-dot-setting) says that even if you're doing an
iisApp sync (or package to iisapp/auto/apphostconfig/whatever), where the provider doesn't have the ignoreErrors setting, you want to use this ignoreErrors setting on any child filePath provider operations (as filePath is a child provider of other providers
like iisApp).
Ah - I wasn't sure what you meant by "work around"! If you mean how can you kill the process that's holding the file and then restart it using Web Deploy - I suggest trying out preSync and postSync runCommand operations to run a command to stop the offending
process before the sync starts, then to run a command to start it again after the sync completes.
If it is the application pool - you can also directly recycle the application pool using the recycleApp provider (possibly still as a preSync command) - that would limit it to recycling just the specified application pool and you wouldn't have to deal with
process start/stop command line. You give the name of the site or app path for the application you want to recycle (like "Default Web Site" or "MySite/MyApp") as the path for recycleApp - not the application pool name. Recycling the application pool when you're
making updates to the application code is probably a good idea regardless.
Is that the kind of thing you were looking for? If you are looking for a way to replace the file without stopping the process using it, I'm afraid nothing comes to mind.
~Kristina
Marked as answer by alexivanoff on May 17, 2012 08:27 PM
alexivanoff
19 Posts
The process cannot access 'file.dll' because it is being used by another process
May 10, 2012 10:02 PM|LINK
We have been using MSDeploy for deploying to one of our webn sites for quite some time with no isues. All dlls were managed. Recently we had to add a native dll to the deployment package. Now every time we deploy we get the following error:
An error occurred when the request was processed on the remote computer. An error was encountered when processing 'file.dll'. The error code was 0x80070020. The process cannot access 'file.dll' because it is being used by another process.
What are our options for fixing this?
fab777
925 Posts
Re: The process cannot access 'file.dll' because it is being used by another process
May 14, 2012 12:04 PM|LINK
Hi, try ProcessMonitor ([url=http://technet.microsoft.com/en-us/sysinternals/bb896645]http://technet.microsoft.com/en-us/sysinternals/bb896645[/url] to know which process is using 'file.dll'.
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
alexivanoff
19 Posts
Re: The process cannot access 'file.dll' because it is being used by another process
May 15, 2012 05:50 PM|LINK
fab777
925 Posts
Re: The process cannot access 'file.dll' because it is being used by another process
May 16, 2012 08:02 AM|LINK
So you can kill it, don't you?
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
alexivanoff
19 Posts
Re: The process cannot access 'file.dll' because it is being used by another process
May 16, 2012 05:09 PM|LINK
We can, but it is not nice.
We are using MSDeploy, so I am looking for a solution that works with MSDeploy.
krolson
350 Posts
Microsoft
Re: The process cannot access 'file.dll' because it is being used by another process
May 16, 2012 09:21 PM|LINK
You can choose to ignore that particular error and basically just skip that file by adding a provider setting filePath.ignoreErrors=0x80070020 on your sync - basically this provider setting format (provider-dot-setting) says that even if you're doing an iisApp sync (or package to iisapp/auto/apphostconfig/whatever), where the provider doesn't have the ignoreErrors setting, you want to use this ignoreErrors setting on any child filePath provider operations (as filePath is a child provider of other providers like iisApp).
FilePath provider page with some explanation of the ignoreErrors setting: http://technet.microsoft.com/en-us/library/ee207414(WS.10).aspx
Hope that helps!
~Kristina
alexivanoff
19 Posts
Re: The process cannot access 'file.dll' because it is being used by another process
May 16, 2012 09:51 PM|LINK
But the file will not be copied/updated, right? This is not what we want.
krolson
350 Posts
Microsoft
Re: The process cannot access 'file.dll' because it is being used by another process
May 16, 2012 10:11 PM|LINK
Ah - I wasn't sure what you meant by "work around"! If you mean how can you kill the process that's holding the file and then restart it using Web Deploy - I suggest trying out preSync and postSync runCommand operations to run a command to stop the offending process before the sync starts, then to run a command to start it again after the sync completes.
RunCommand provider page: http://technet.microsoft.com/en-us/library/ee619740(WS.10).aspx
Format example for preSync/postSync on this page: http://technet.microsoft.com/en-us/library/dd569089(WS.10).aspx
alexivanoff
19 Posts
Re: The process cannot access 'file.dll' because it is being used by another process
May 17, 2012 02:37 AM|LINK
krolson
350 Posts
Microsoft
Re: The process cannot access 'file.dll' because it is being used by another process
May 17, 2012 03:14 PM|LINK
If it is the application pool - you can also directly recycle the application pool using the recycleApp provider (possibly still as a preSync command) - that would limit it to recycling just the specified application pool and you wouldn't have to deal with process start/stop command line. You give the name of the site or app path for the application you want to recycle (like "Default Web Site" or "MySite/MyApp") as the path for recycleApp - not the application pool name. Recycling the application pool when you're making updates to the application code is probably a good idea regardless.
More info on recycleApp provider: http://technet.microsoft.com/en-us/library/ee522997(WS.10).aspx
Is that the kind of thing you were looking for? If you are looking for a way to replace the file without stopping the process using it, I'm afraid nothing comes to mind.
~Kristina