Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express Web Server Port Is In Use

I can normally debug my web service with no problem, but now I persistently get error "Unable to launch the IIS Express Web Server. Port 3268 is in use". I have looked at previous questions about this, but I am stuck:

  • it doesn't matter what port I use

  • rebooting, closing web browser, deleting web history etc all fail

  • tools like TCPView show that the port is NOT in use

  • I can start/stop IISExpress from a command prompt OK

  • normally, address localhost:3268 shows an error message in a browser - but after loading the project in Visual Studio (and BEFORE starting to debug the project, or doing anything at all to it), localhost:3268 shows a web page in the browser

like image 756
Graham Laight Avatar asked Jan 20 '16 11:01

Graham Laight


People also ask

Why and how do you fix IIS Express the specified port is in use?

The Solution Restart the computer. Add the port you are using to the port exclusion range: netsh int ipv4 add excludedportrange protocol=tcp startport=50403 numberofports=1 store=persistent. Reenable Hyper-V. Restart the computer.

What port is IIS Express using?

By default, you can use IIS Express to run your website using a non-reserved port such as 8080. However, using a reserved port such as 80 or 443 requires work.

How do I resolve a port already in use?

If you are running the Development Application Server, changing the port used by the server is the easiest solution. Change the Server Port in the Application Server Control Panel and start the server. Specify a port that is not 80, such as 8080. Changing the port number may not desired in a Production environment.

How do I stop the IIS Express port?

Closing IIS Express By default Visual Studio places the IISExpress icon in your system tray at the lower right hand side of your screen, by the clock. You can right click it and choose exit. If you don't see the icon, try clicking the small arrow to view the full list of icons in the system tray.


4 Answers

I was having these issues with specific projects.

For me,

  • no website was running iin IIS Express
  • nothing was using the port as determined by running: netstat -ano at the command line.

The solution was to run

netsh http add iplisten ipaddress=::

from the command line.

Happy days, and credit to: James Bryant! https://developercommunity.visualstudio.com/content/problem/110767/specified-port-is-in-use.html

like image 99
Liam Fleming Avatar answered Oct 14 '22 03:10

Liam Fleming


1, firs click properties.

1. click properties

  1. Click web tab and in servers section change the port number. (simply increment or decrement the last digit

After that click "Create Virtual Directory" button. Then debug and run. Click web tab and in servers section change the port number

I hope this will solve your problem

like image 41
Abdulhakim Zeinu Avatar answered Oct 14 '22 03:10

Abdulhakim Zeinu


You can change the port of the website from the website properties under the web ribbon, specifying a different port other than 3268.

Also a link from the Stackoverflow discusses the same scenario

Why and how to fix? IIS Express "The specified port is in use"

like image 31
Krishna P S Avatar answered Oct 14 '22 04:10

Krishna P S


The link that Krishna provided inspired me to open IIS and discover that there was a local web site in IIS with the same port (it was the same web service). I deleted that, and now I can debug my application again.

I cannot explain why I couldn't see the port in use, why it started offering the web page when the project was loaded in Visual Studio, and why I couldn't see that IIS was running in the task manager. I am guessing that Visual Studio was actually running it somehow.

Thanks to all respondents for their help!

like image 42
Graham Laight Avatar answered Oct 14 '22 03:10

Graham Laight