Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2019 “Unable to connect to web server 'IIS Express'”

I attempt to lunch my ASP.NET Core project in Microsoft Visual Studio 2019 and got this error: "Unable to connect to web server 'IIS Express'"

  • Visual Studio 2019 Version 16.9.5
  • .Net 5.0
like image 884
Mohammad Reza Nouri Avatar asked Dec 01 '22 13:12

Mohammad Reza Nouri


2 Answers

I tried this one and it worked for me:

  1. Go to 'Debug Properties'

  2. Find 'Web Server Settings'

  3. Change the port in 'App URL' section and save the changes

  4. Run the application and the same error will appear again

  5. Switch the port back to the original port and save the changes

  6. Run the application and enjoy it!

I hope this trick work for you.

like image 125
Mohammad Reza Nouri Avatar answered Dec 03 '22 03:12

Mohammad Reza Nouri


The following fixed the problem for me.

  • Delete the "properties\launchsettings.json" file. The above solution has worked for other users too as per https://developercommunity.visualstudio.com/t/unable-to-connect-to-web-server-iis-express-in-vs/1027196
like image 45
Pradeep Singh Avatar answered Dec 03 '22 03:12

Pradeep Singh