Unable to launch the IIS Express Web Server - Error 0x80070020

less than 1 minute read

Recently I received an error 0x80070020 when trying to launch IIS Express stating

Unable to launch the IIS Express Web server.

Failed to register URL “http://localhost:49286/@ for site …. The process cannot access the file because it is being used by another process. (0x80070020)

IIS Express

Error code 0x80070020 means ERROR_SHARING_VIOLATION, which in the case of IIS Express (or IIS) means that the port that IIS Express is attempting to listen on is being used by another process.

To find out which application is using the port, the netstat command can be used.

netstat -ao | findstr <port_number_to_search_for>

The a parameter tells netstat to display all connections and listening ports.

The o parameter tells netstat to display the process ID associated with the connection.

Running the above netstat command will produce output such as:

C:\\>netstat -ao | findstr 49286
  TCP    0.0.0.0:49286        david-pc:0         LISTENING       872
The last number displayed (872 here) is the process ID.

In my case, the process running was the Windows store, so closing this down allowed me to run IIS Express again as expected.

Updated: