One or more files in the directory may be locked by another process

Hi
While trying to copy files to my website i get this error:
“Unable to copy the package to the specified directory ‘e:\ActiveTrail\mymarketing.co.il’. One or more files in the directory may be locked by another process. You could use a PreDeploy.ps1 script to stop any processes that may be locking the file. Error details follow.
The process cannot access the file ‘e:\ActiveTrail\mymarketing.co.il\Masters\ImportCustomers.Master’ because it is being used by another process.
System.IO.IOException: The process cannot access the file ‘e:\ActiveTrail\mymarketing.co.il\Masters\ImportCustomers.Master’ because it is being used by another process.”

Is There a way to overcome this problem without stopping the application pool?
And if not, any examples doing so via script?

Tnx,
Uri

Hi Uri,

Generally, IIS web sites behave better when a custom installation folder is not used; if you let Octopus choose a new release-specific location for the site, and let it update IIS accordingly (it will do this automatically if you’re using the feature) you won’t hit this issue.

Otherwise, automating IIS with PowerShell is the best option - how this is done requires a bit of research; I think Stop-WebAppPool is the cmdlet: http://technet.microsoft.com/en-us/library/ee790553.aspx

Regards,

Nick