Why and how to fix? IIS Express “The specified por

2019-01-17 09:39发布

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

  1. Try switching to port other than 10360 and higher than 1024.
  2. 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?

19条回答
兄弟一词,经得起流年.
2楼-- · 2019-01-17 09:48
  1. change it in solution (right Click) -> property -> web tab
  2. Click Create Virtual Directory (in front of project Url textbox)

IIS Express port change for fixing port in use

查看更多
闹够了就滚
3楼-- · 2019-01-17 09:48

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.

查看更多
萌系小妹纸
4楼-- · 2019-01-17 09:48

Visual studio 2015

  • Close all the files you have open inside Visual studio.
  • Then close application and exit Visual Studio.
  • Open Visual Studio and it should successfully run.

I hope this helps.

查看更多
狗以群分
5楼-- · 2019-01-17 09:49

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

查看更多
做个烂人
6楼-- · 2019-01-17 09:51

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.

查看更多
贪生不怕死
7楼-- · 2019-01-17 09:54

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.

查看更多
登录 后发表回答