Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IISExpress does not start from Visual Studio 2015

Tags:

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.

like image 491
Joerg Krause Avatar asked Jul 20 '16 16:07

Joerg Krause


People also ask

How do I open IIS Express in Visual Studio 2015?

1) In Solution Explorer, right click the your project and click Properties. 2) In the left tab, click Web. 3) Select IIS Express, check out your Project Url, then create Virtual Directory.

How do I enable IIS Express in Visual Studio?

Configure IIS express on visual studioSelect the web application project and open properties -> select the web tab -> under server's select IIS express-> Specify the project URL. Now open the project folder and . vs folder (Hidden) -> Config -> applicationhost.


2 Answers

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.

like image 189
Joerg Krause Avatar answered Sep 28 '22 09:09

Joerg Krause


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/

like image 29
Coskun Ozogul Avatar answered Sep 28 '22 10:09

Coskun Ozogul