Tuesday 30 March 2010

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

When starting IIS 7 under Vista or Windows 7, you receive the error from the IIS Manager saying "The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)"

The reason for this is well documented, and it is because you have another site setup with the same binding - in english, this means you have two sites setup that are configured to use the same port (probably 80).

In my circumstances, this was confusing because I had only one IIS instance and this was bound to port 80, but wouldn't start.

So, to find out what was conflicting, I went to the command prompt and typed:

NETSTAT -ano

This showed an entry of address 0.0.0.0 using port 80 up!

This also showed the process ID of 4400, so I looked in task manager and found that this was Skype.exe

After digging through the advanced settings in Skype, it appears that by default, Skype decides to listen on ports 80 and 443 for incoming connections (probably to appeas firewalls), so unticking this allowed my IIS to start.

Useful to find out, but it took a while!