I was looking at a .NET Core project and wanted to change from http to https.
So under Properties / Debug, I checked the "Enable SSL" checkbox.
This changes the port so I then did a copy / replace of the old port to the new one and changed the URL to https e.g.
http://localhost:5000 became https://localhost:44326
Then I got "Unable to connect to web server IIS Express".
Consulted with Mr. Google.
The solution that worked for me was to:
- Close the VS project
- In File Explorer, navigate to the project and delete the entire ".vs" folder
- Restart the project
- Run as "Debug"