"Unable to launch the IIS Express Web server" error

156,636

Solution 1

The one thing that fixed this for me was using the following line in the <bindings> section for my site in the applicationhost.config file:

<bindings>
    <binding protocol="http" bindingInformation="*:8099:" />
</bindings>

The key was to simply remove localhost. Don't replace it with an asterisk, don't replace it with an IP or a computer name. Just leave it blank after the colon.

After doing this, I don't need to run Visual Studio as administrator, and I can freely change the Project Url in the project properties to the local IP or computer name. I then set up port forwarding and it was accessible to the Internet.

EDIT:

I've discovered one more quirk that is important to getting IIS Express to properly serve external requests.

  1. If you are running Visual Studio/IIS Express as an administrator, you must not add a reservation to HTTP.SYS using the "netsh http add urlacl ..." command. Doing so will cause an HTTP 503 Service Unavailable error. Delete any reservations you've made in the URLACL to fix this.

  2. If you are not running Visual Studio/IIS Express as an administrator, you must add a reservation to the URLACL.

Solution 2

If using VS2015, close the solution, delete the following file, then re-open the solution.

<<path_to_solution_folder>>\.vs\config\applicationhost.config

note the .vs folder may be hidden

Solution 3

I had exactly the same issue. Tried everything but finally one trick worked.

  1. Delete folder IISExpress from "My Documents"
  2. Load your project again, it will create IISExpress folder again with updated configuration
  3. Check IISExpress folder has sufficient permissions to read-write the configuration file
  4. Load project again and Run IISExpress. It should work.

Solution 4

  1. Close your project.
  2. Go to folder settings and select show hidden folders option.
  3. Open the folder where your application is. You will see a .vs folder.
  4. Open the .vs folder, you will see a config folder in it. Delete its content.
  5. Run Visual Studio in admin mode. Open your solution from the File menu.
  6. Clean your solution.
  7. Build it.
  8. Run it and voila!

I do not recommend deleting IIS Express folder or messing with the config file in it.

Solution 5

I was changing this entry (for which my web server was not running and showing me access denied error for a particular port)

<bindings>
   <binding protocol="http" bindingInformation="*:61235:localhost" />
</bindings>

in the "applicationhost.config" in "Documents\IISExpress\config" for a particular webapplication it was overwritten by Visual Studio 2012 again to default port whenever I was starting my webapplication.

But I resolved the problem by doing nothing in the applicationhost.config. I just changed the "project properties" > "web" > "project url" setting from http://localhost:62135/ to http://localhost:47279/(depends on your computer) and it worked for me.

Share:
156,636
Trevor Elliott
Author by

Trevor Elliott

Updated on July 08, 2022

Comments

  • Trevor Elliott
    Trevor Elliott almost 2 years

    I receive this error when trying to launch IIS Express from Visual Studio with a project that's configured to listen to an address other than localhost. Visual Studio freezes for about 30 seconds before giving the error "Unable to launch the IIS Express Web server".

    I've tried all the solutions posted to similar questions and I think I've done everything correctly. Here are the steps that I have taken:

    1. Add the following reservation to HTTP.SYS:

      netsh http add urlacl url=http://+:36899/ user=Everyone

    2. Run Visual Studio 2012 as an administrator (technically I don't think I should even have to since I set up HTTP.SYS manually).

    3. Disable Windows Firewall.

    4. Delete my IISExpress folder in my My Documents folder to ensure the default settings.

    5. Allow Visual Studio to create the entry in applicationhost.config for my web project. Then manually edit the config file to change localhost to 192.168.0.100 which is my local IP. Then go back into the project properties in Visual Studio and change localhost to the IP and save the project so that my project is now set to http://192.168.0.100:36899.

    I also tried changing the port and repeating the above steps just incase the port was in use for some reason.

    I want to make my IIS Express developer instance accessible from my IP on the Internet for remote testing.