Wednesday, 24 October 2012

IIS Deployment and Windows Server AppFabric services.


I had been getting the following error intermittently while deploying some IIS artifacts on a Windows 2008 server with Windows AppFabric installed on it

FileLoadException: The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

Since, all deployments to IIS result in modifications to the applicationHost.config file, it was obvious that the FileLoadException was raised for this file. Using the Unlocker utility, I found that the file was locked by the two AppFabric services i.e. "AppFabric Event Collection Service"  and "AppFabric Workflow Management Service".

The workaround is to stop the two services before you do any deployment on IIS and start them afterwards.

If you are not familiar with applicationHost.config file, this link is a good resource to understand the structure and use of this file.

No comments: