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'"
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.
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.
The following fixed the problem for me.
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!
To me it has worked by switching the project from Debug to Release and Starting it. When I switch back to Debug it starts correctly. It appears to me that For some reason i had the Release project running so the Debug couldn't start.
I have just an API project. Going to project's Properties\Debug and unchecking the 'Launch browser' helped.
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

In my case... (Visual Studio 2019, .net 5, blazor wasm project):
Now you can redo your updates on the "Properties\launchSettings.json" (i.e. change port).