When we face address already in use issue and we don't know how to check whether this port is already used or not. Below is the command to check and kill that specific port so that you can deploy your application on the same address again.
- Check whether the port is in use or not
-
netstat -ano | findstr :<PORT>-
<PORT> is the port number that you want to check. For ex: netstat -ano | findstr :8184
-
You will get a result similar to the one below:
Ex: here PID= 8024 TCP 0.0.0.0:8183 0.0.0.0:0 LISTENING 8024 TCP [::]:8183 [::]:0 LISTENING 8024
-
-
-
Kill any process using the port
-
taskkill /PID <PID> /FEx: taskkill /PID 8024 /F Where PID is the value we get from point 1
-
-
After killing the process, rerun the netstat command to check the output. You will not see any result this time, meaning PORT is free now.