Joerg Krause
Joerg Krause

Reputation: 2179

IISExpress does not start from Visual Studio 2015

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.

Upvotes: 20

Views: 21067

Answers (4)

Etienne
Etienne

Reputation: 1106

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.

Upvotes: 0

Coskun Ozogul
Coskun Ozogul

Reputation: 2487

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/

Upvotes: 2

Nur Jalih
Nur Jalih

Reputation: 1

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"
      }
    }
  }

Upvotes: 0

Joerg Krause
Joerg Krause

Reputation: 2179

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.

Upvotes: 45

Related Questions