Visual studio 2019 调试选项 IISExpress 已从下拉列表中消失

Visual studio 2019 debugging option IISExpress is gone from drop down

在 Visual Studio 2019 中使用 IISExpress 进行调试的选项未显示在调试器下拉列表中,它仅显示 Docker 撰写选项。

如何让 IISExpress 选项出现?

这是我的launchsettings.json 文件:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:56466",
      "sslPort": 44311
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "DirectoryTools": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001;http://localhost:5000"
    },
    "Docker": {
      "commandName": "Docker",
      "launchBrowser": true,
      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/api/values",
      "httpPort": 10003,
      "useSSL": true,
      "sslPort": 44382
    }
  }
}

我遇到了同样的问题。 您可以通过从解决方案 (.sln) 上下文菜单中 selecting Properties 来启用 IIS Express debug/run,然后在 Startup project 菜单中,选择 Single startup project 单选按钮,并从下拉列表 select 中选择与您的 Web 应用程序相对应的 Project。应用更改后,您应该会在工具栏中看到“IIS Express”按钮重新出现。