Solution#
When running the project with IIS Express in Visual Studio, the exception "[Unable to connect to the Web server 'IIS Express']" may occur:
Solution steps:
- Close Visual Studio
- Delete the
.vs
directory in the project root directory - Delete all subdirectories under
C:\Users\Administrator\Documents\IISExpress
(Documents), whereAdministrator
is the username currently logged in and needs to be replaced according to your own situation - Reopen the project with Visual Studio and start the project with IIS Express
Note:
-
iisSettings.iisExpress.applicationUrl
cannot be configured as0.0.0.0
or*
. If you need to bind to a LAN IP, you need to fill in the actual LAN IP of the local machine. If using Kestrel to start, you can directly configure it as0.0.0.0
or*
, refer to:{ "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:44372/", "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "XXW.IDCloud.Web": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://*:44372/" } } }