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条回答
Emotional °昔
2楼-- · 2019-01-17 10:07

For me, the Google Chrome browser was the process which was using the port. Even after I closed Chrome, I found that the process still persisted (I allow Chrome to "run in background" so that I can receive desktop notifications). I went into Task Manager, and killed the Chrome browser process, and then started my web application, it worked like a charm.

查看更多
一纸荒年 Trace。
3楼-- · 2019-01-17 10:08

If netstat doesn't show anything, try a reboot.

For me, nothing appeared in netstat for my port. I tried closing Google Chrome browser windows as @Clangon and @J.T. Taylor suggested, but to no avail.

In the end a system reboot worked, however, so I can only assume that something else was secretly holding the port open. Or perhaps it just took longer than I was prepared to wait for the ports to be released after Chrome shut down.

查看更多
神经病院院长
4楼-- · 2019-01-17 10:08

Open Task Manager and Just Close all processes of 'IIS Express System Tray' and 'IIS Express Worker Process' and Re-run the Project

Task Manager Process Details

查看更多
forever°为你锁心
5楼-- · 2019-01-17 10:09
  1. Close the VS
    1. Start again - right click and run as admin
    2. Run your project again.
查看更多
The star\"
6楼-- · 2019-01-17 10:13

Running visual studio in administrative mode solved my issue

查看更多
三岁会撩人
7楼-- · 2019-01-17 10:13

I had same error showing up. I had my web service set as an application in IIS and I fixed it by:

Right-click on my WebService project inside my solution > Properties > Web > Under 'Servers' change from IIS Express to Local IIS (it will automatically create a Virtual Directory which is what you want)

查看更多
登录 后发表回答