c# - ASP.NET 5 MVC: unable to connect to web server 'IIS Express'

ID : 10254

viewed : 20

Tags : c#asp.netasp.net-mvcvisual-studio-2015c#

Top 5 Answer for c# - ASP.NET 5 MVC: unable to connect to web server 'IIS Express'

vote vote

94

After installing Update 2 for Visual Studio 2015 I started getting the same error. I tried everything above with no luck. However, I found a solution that works for me:

  1. Delete YourSolutionFolder\\.vs\config\applicationhost.config file (note: .vs is a hidden folder)
  2. Open Visual Studio, right-click on web site > Properties > Debug tab > Web Server Settings > App URL - change port number.

If you have IIS configured to use the same port, (stop the application / use different port) and try again.

vote vote

88

Exit VS and delete the (project)\.vs\applicationhost.config file. Restart VS. It should start working.

vote vote

78

Try using a different port. I just set up a new Core 1.0 RC1 project and got the same error.

  • Right click web project
  • Debug tab
  • Toggle Enable SSL off and on again, it should generate a new random port
  • Copy the SSL URL and paste into Launch URL box
  • Run the project

Worked for me (TM).

Answer from: https://stackoverflow.com/a/28650554/134761

enter image description here

vote vote

65

I had this issue on .net core 2.1, visual studio version 15.9.6. When i deleted the .vs folder, i reopened visual studio and the problem was still there. The solution that worked for me below:

  1. Delete .vs folder (it is a hidden folder).
  2. Restart Computer.

Other Solutions:

  • Close Visual Studio, delete bin and obj folders from the project folder. Open Project then rebuild solution.
  • Try running Visual Studio as Administrator.
  • Clean Solution then rebuild
    1. Clean Solution. 2) Exit Visual Studio. 3) delete .vs folder 4) Re-open Visual Studio
  • Restart machine (if you can afford to)
vote vote

50

I faced this issue in .net core 2.0 when I update my project's port number.

I was able to sort out issue in two steps :

  • STEP 1 : DELETE .vs folder which is hidden inside main solution folder. (close visual studio before this) then when you start again visual studio, this folder and file (applicationhost.config) inside it will automatically create by visual studio.
  • STEP 2 : For multiple startup projects, if you are still facing issue then one by one run project as startup, and then run as multiple startup project.

Top 3 video Explaining c# - ASP.NET 5 MVC: unable to connect to web server 'IIS Express'

Related QUESTION?