myesn

myEsn2E9

hi
github

IIS cannot connect to the web server "IIS Express"

Solution#

When running the project with IIS Express in Visual Studio, the exception "[Unable to connect to the Web server 'IIS Express']" may occur:
image

Solution steps:

  1. Close Visual Studio
  2. Delete the .vs directory in the project root directory
  3. Delete all subdirectories under C:\Users\Administrator\Documents\IISExpress (Documents), where Administrator is the username currently logged in and needs to be replaced according to your own situation
  4. Reopen the project with Visual Studio and start the project with IIS Express

Note:

  • iisSettings.iisExpress.applicationUrl cannot be configured as 0.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 as 0.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/"
        }
      }
    }
    

Reference#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.