20

There are several questions here why IISExpress does not launch. The answers I found did not help. But I found the answer myself. This post may help others resolve the issue.

Behavior: You open a web project you copied from somebody else in Visual Studio 2015. You cannot select Browsers and when you start using F5 you get a message that says

Unable to launch the IIS Express Web server.

There is no indication why. Deleting applicationHost.config does not help, restarting / reinstalling etc. does not help either. Admin mode doesn't matter and a new project an the target machine works as expected.

nless
  • 156
  • 3
  • 16
Joerg Krause
  • 1,759
  • 1
  • 16
  • 27
  • Does this answer your question? [Unable to launch the IIS Express Web server](https://stackoverflow.com/questions/15873126/unable-to-launch-the-iis-express-web-server) – Michael Freidgeim Jul 13 '21 at 22:06

4 Answers4

45

Resolution: First I found that opening the very same project in VS 2012 works, it starts IISExpress just fine. So what's different? It's the .vs folder in the projects root and here especially the file .suo where all the user settings specific for Visual Studio 2015 reside.

Delete the folder .vs if you copy a project from another user/machine. Then open the project. It will create a new settings store on the fly. The project will run just as before and IISExpress works as expected.

If you can't see this folder - it's hidden. So make hidden files visible before this step.

Elder projects and elder VS versions does not have the .vs folder and hence no need to delete it.

Joerg Krause
  • 1,759
  • 1
  • 16
  • 27
  • 2
    And before removing the .vs close the VS solution – Jean-Marie Oct 25 '16 at 10:09
  • If using VS2015 and a .net Core project, also delete launchSettings.json out of /Properties – Christopher Mar 04 '17 at 21:00
  • 1
    we have copied project from another user/machine. Deleting .vs folder and reopening project works fine for us. – arpan desai Mar 15 '17 at 13:18
  • I had the same problem with VS 2017 where IIS would launch but my project wasn't added and the page wouldn't load. Performing the above and deleted the .vs folder fix this for me and I can finally launch my project :) – Cliff Cawley Jun 25 '17 at 04:58
  • 1
    If this is the "resolution", accept your own answer and close the thread. – Lex Li Sep 15 '18 at 16:30
2

I just want to share my experience. In my case, I had VS 2015 and VS 2017 installed on my post. I uninstalled VS 2017 and it caused this problem.

this post worked in my case:

  1. Delete the \Documents\IISExpress folder using the following console command:

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

  2. Delete the applicationhost.config the file which is placed within the \.vs\Config\ folder in your Visual Studio project root folder.

  3. Close Visual Studio and re-start it with Administrative privileges (right-click > Run as Administrator).

  4. Change the project’s website random URL: within Visual Studio, right-click to the project node in Solution Explorer, then select Properties; navigate through the Web panel, then change the number in the Project Url textbox value.

  5. Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1 (As it is shown on the image on the link.) (I didn't do this step on my post, it worked by doing the first 4 steps).

https://www.ryadel.com/en/unable-launch-iis-express-web-server-error-visual-studio-2015-fix/

Jan Sršeň
  • 1,045
  • 3
  • 23
  • 46
Coskun Ozogul
  • 2,389
  • 1
  • 20
  • 32
0

If your project is ASP.Net Core, just open VS by run as administrator and then change file launchsetting.json by deleting below config in there

,
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
Jan Sršeň
  • 1,045
  • 3
  • 23
  • 46
0

In my case it was because the port for the project I was trying to debug was being by another program. Simple fix is to use another port for IIS express, or find what program is using the other port and close it.

Etienne
  • 1,058
  • 11
  • 22