launchSettings.json commandName 用法

launchSettings.json commandName usage

每次我找到一些 launchSettings.json 文件,它们具有以下结构:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:40088/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express (Staging)": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Staging"
      }
    }
  }
}

找到 here

但是,我找不到任何关于属性 commandName 的文档。

commandName的用法是什么?

命令名称映射到项目的启动方式。 Visual Studio 将其用于 运行 您的项目。

  • IISExpress很明显是用IIS Express来启动项目。
  • Project表示项目直接在命令行用.NET CLI执行。