Visual studio 2019 “Unable to connect to web server 'IIS Express'”
Solution 1
I tried this one and it worked for me:
-
Go to 'Debug Properties'
-
Find 'Web Server Settings'
-
Change the port in 'App URL' section and save the changes
-
Run the application and the same error will appear again
-
Switch the port back to the original port and save the changes
-
Run the application and enjoy it!
I hope this trick work for you.
Solution 2
1- Go to 'Debug Properties', Find 'Web Server Settings', Change the port in 'App URL' section and save the changes
In your project folder, delete .vs file, also remove the launch settings file in properties (make sure you copy to a different folder before removing it).
Restart visual studio and your machine if possible. Go to launch setting, check if they are properly configured similar to your prev launch settings. Run the application in IIS.
Should start working.
Solution 3
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
Solution 4
From my experience this issue appears when the port used is already in use by other process. You will see the following:
Error description: The process cannot access the file because it is being used by another process. (0x80070020)
Just choose a port number which is free to use and the problem will disappear!
Solution 5
I encountered the same issue , but after few seconds i find out that there is a duplicated sslport , the same sslport being registered for another running app , so when i run another app with the same setting i see this error , you have to change the sslport in the launchsetting.json
Mohammad Reza Nouri
Updated on June 15, 2022Comments
-
Mohammad Reza Nouri almost 2 years
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