How to configure the port number of IIS Express to another port other than 8080.

8

I've seen numerous other posts on this topic, but none that solves my problem (and I'm pulling my hair out trying to get this working!). I'm trying to create a simple one-page website in VS2013 (windows 8.1) and view the page in Firefox and I can't do it - I get "Unable to launch IIS Express Web Server"

Then I get an error message from IIS Express that says "The specified port is in use: Port 8080 is already being used by process IIS Express (process ID '6332') Recommendations: 1. Try switching to a port other than 8080 and higher than 1024. 2) Stop the application that is using port '8080'"

When I click on the Open Log File link I get:

Failed to register URL "http://localhost:8080/" for site "WebSite1" application "/".     Error description: Cannot create a file when that file already exists. (0x800700b7)
Failed to register URL "http://localhost:63997/" for site "WebApplication2"         application "/". Error description: Cannot create a file when that file already exists. (0x800700b7)
Failed to register URL "http://localhost:64532/" for site "WebApplication3" application "/". Error description: Cannot create a file when that file already exists. (0x800700b7)
Registration completed

I tried uninstalling IIS Express and VS 2013 and then reinstalling VS 2013. I even uninstalled VS2010 which was also on my machine. I've also tried changing the Project URL to use port 8090 and that doesn't help either.

Please help!

visual-studio-2013
iis-express
asked on Stack Overflow Apr 16, 2014 by Ben_G • edited Apr 16, 2014 by Pete

2 Answers

29

I had a similar issue. I was able to run my Project in the debug mode, but non-debug-mode project did not even start because of similar error.

In my situation the problem was that I tried to access the same port number with having standard HTTP connection and secure HTTPS connection.

There are lot of posts indicating that you should edit .../Documents/IISExpress/config/applicationhost file, but that was not working with me, because my Visual Studio Project always rewrote non-working values to the applicationhost file.

Therefore I found the resolution by redefining my Visual Studio Project Properties as follow:

  1. Click: YourWebApp => Properties => Web (tab)

  2. On Servers section, enter Project Url, as example: http://localhost:44301/ Note: Value 44301 has to be something which has to be unique - Not used by any other apps or in the SSL-connections in YourWebApp project

  3. Click YourWebApp in the Solution Explorer.

  4. Press F4 to open YourWebProject properties. On Development Server section check SSL Enabled property and SSL URL property. If the SSL enabled property is set as True, then YourWebApp uses the URL and port defined in the SSL URL field. Also this url + port has to be unique.

  5. If SSL URL property contains the same port number than defined in step 2 ( https://localhost:44301/), then you have one port assigned both for HTTP and HTTPS connections, and that is not allowed. Then you have either change the port number as unique either on the Project URL or in the SSL URL

answered on Stack Overflow Mar 1, 2015 by Petri
1

You can change the binding for your website by modifiy the ApplicationHost.config on %systemdrive%:\Users\\Documents\IISExpress\config

http://msdn.microsoft.com/en-us/library/ms178109.ASPX

answered on Stack Overflow Apr 17, 2014 by MilitelloVinx

User contributions licensed under CC BY-SA 3.0