After I installed a SSL certificate to our IIS 7, any attempt to "Start" the website would result in this error message.
The process cannot access the file because it is being used by another process
I was like... "huh??"
It turned out that our VisualSVN server (a Windows Service process) was the issue. It was using port 443 which was preventing SSL-enabled website to start up.
I used
CurrPorts to figure out who was using port 443.
Specify the following lines in its "filter" and you will see a list of processes, with their PID, who have opened port 80 and port 443
include:local:tcp:80
include:local:tcp:443
With the PID value and Task Manager, I found out that VisualSVN server was opening 443, but it was using a different IP address than the one I am using for our game website. What gives?
#1 Change VisualSVN Server Binding to a single IP address
I started VisualSVN GUI and clicked "Configure authentication options..." and in its "Network" tab, I found that "Server Binding" was set to "All IP addresses". That doesn't look right, and there is an alternative option called "These IP addresses", which takes a list of IP addresses, so I switched to it and gave the IP address it was bound to.
Now, I thought it would fix the website start up problem... but No! I was still getting the same "The process cannot access the file because it is being used by another process" error message.
It was clear to me that VisualSVN server process was causing the problem because if I stop the service then I can start the SSL-enabled website without any issue. The problem is that once I start the website, then I wan't able to start VisualSVN.
To fix the problem, I did a couple of things described below. I think the action #3 is actually attributed to fixing the problem, but #2 may also be part of it. I don't feel like undoing neither to just to find out that. I already spent hours on this and don't want break anything...
#2 Configure ListenOnlyList Windows registry subkey properly
I checked the registry, and our machine did not have ListenOnlyList registry subkey. According to KB article, absence of ListenOnlyList subkey implies that it would operate on "any IP addresses". I am not quite sure what this really implies to my situation, but I wanted to eliminate any "blanket" rules like that, so I created ListenOnlyList subkey and added all of the IPs that this box was using.
#3 Change the port VisualSVN uses to something other than 443
The previous step did not fix the problem. I was still getting the same error message. Then next logical step is to not to use the same port. Luckly, SVN was for private use only and all we wanted was its transmissions were encrypted, so I could use any port. So, I chose another port value for SVN in VisualSVN GUI.
Of course, this causes all existing sandboxes on developers' machines to be invalid. To fix this, all we had to do was to invoke "relocate..." command on developers' machine to map to the new address of the SVN repository, which now needs an explicit port number as part of its URL.
After this, both website and VisualSVN server were running, providing the intended functionality.