I was trying to run IIS Express for debugging the other day but apparently the port that IIS Express is trying to bind was already in used by other process:

so, only terminate the process if you are sure that it is not being used by a critical process or application.

Alternatively, you can terminate the process that is using the port number to release it.

First, we need to find out which process is using the port number. To do this, we can use the netstat utility available in windows.

Run command line (cmd) and enter the following command, replace <port_number> with the port number that you are trying to find:

netstat -aon | findstr <port_number>

The command above will pipe the output from netstat to the findstr command to filter out the result, because by default netstat will return a list of all TCP/IP network connections being used, but in this case we are only interested to find out connections for a specific port number.

The -aon parameters that we pass will do the following: -a: Display all connections and listening ports. -o: Display the Owning process ID associated with each connection. We need this parameter to find out the process ID -n: Display addresses and port numbers in Numerical form. No DNS lookup since the addresses are displayed in numerical form.

The command above will should return the list of connections that are currently listening to the port number along with the associated process ID.

Take note of the process ID, and run the following command to terminate it:

taskkill /pid <process_id> /f

Replace <process_id> with the process ID listed in the netstat result. The /f parameter is added to forcefully terminate the process.