We know a random port number is assigned to a web application in Visual Studio. It works fine in my office desktop. But when I pull the code onto my laptop (from VisualStudio.com) and run the web app. I got a message, saying,
The specified port is in use
Port 10360 is already being used by another application.
Recommendations
- Try switching to port other than 10360 and higher than 1024.
- Stop the application that is using port 10360.
I can fix it using Recommendation #1
by changing the port into something else like 13333. But I am very curious what happened to port 10360. How can I check what application is using port 10360? How can I stop that application?
You're looking for
netstat
.Open an administrative command shell and run
netstat -aob
And look for port 10360. It'll show you what executable opened the port and what PID to look up in Task Manager. (Actually, run
netstat -?
in an unprivileged shell first, because I don't approve of blindly running anything you don't understand, especially in a privileged context.)Here's what the switches do:
-a
shows all connections or open ports, not just active ones - the port you want is probably listening, not active.-o
shows the owning PID of the connection or port, so you can find the process in Task Manager's Processes tab. (You might need to add the PID column in Task Manager. View->Select Columns)-b
shows the binary involved in opening the connection or port. This is the one that requires elevated access.Visual studio 2015
I hope this helps.
click on the notification present on bottom of the task bar if you receiving the error like port in use then select the iiss icon right click then click on exit ,it work like charm for me
The error message should tell you which application is already using the port - in my case it was explorer.exe, so it was just a case of restarting explorer from task manager.
I had the same problem, but no proccess appeared neither in netstat nor in resmon.
What solved the problem for me was closing all the open browser windows.