Unable to launch the IIS Express Web server

Solution 1:

I had the exact same problem.
The reason - bad IIS config file.

Try deleting the automatically-created IISExpress folder, which is usually located at %userprofile%/Documents, e.g. C:\Users\[you]\Documents\IISExpress.

Don't worry, VS should create it again - correctly, this time - once you run your solution again.


EDIT: Command line for deleting the folder:

rmdir /s /q "%userprofile%\Documents\IISExpress"

Solution 2:

If using VS2015 or above

Make sure iisexpress process is not running.

Make sure no other process is using your desired port. You can do that by executing

netstat -a -b

in the console (as Administrator, type cmd in start menu, right click and choose 'Run as admiminstrator'). If you see an entry which state is ESTABLISHED or LISTENING for example it means that some other process is using this port. You'll need to terminate that process or change the port.

Then delete the following file

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

note the .vs folder may be hidden

then find <<project-name>>.csproj.user file, open it with text editor (notepad) and make sure IISUrl under WebProjectProperties is configured to <IISUrl>http://localhost:XXXXX/</IISUrl> where XXXXX is your desired port.

after doing this and trying to start the app you may get

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Then go to {Project Properties} -> Web and Press the "Create Virtual Directory" button

enter image description here

Solution 3:

@roblll had it right. But for those of you who didn't want to dig for the answer, here it is:

  1. Close Visual Studio (might not be necessary, but it won't hurt).
  2. Navigate to your Documents folder. This is where my IISExpress configuration directory was.
  3. In the config folder, there is a file called the application host. Open that.
  4. Search for the name of your project. It should have been added in there by Visual Studio when it bombed in your previous attempts.
  5. Note that there's a binding for HTTP with the port you intend to use for https.

    //Change this:
    <binding protocol="http" bindingInformation="*:44300:localhost" />
    
    //to this:
    <binding protocol="https" bindingInformation="*:44300:localhost" />
    

Keep in mind, Visual Studio might have supplied different ports than you expected. Just make sure that the ports in the binding correspond to what's in the Web tab of your project's properties.

http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx