ASP.NET Core默认调试启动URL

Bla*_*ord 17 asp.net-core-mvc asp.net-core

使用ASP.NET Core Web API模板时,默认调试启动URL以某种方式设置为api/values.这是默认配置的位置,如何更改?

Bla*_*ord 23

关于这个启动URL的声明位置,我找不到很少的文档.在MSDN上的这篇博文中简要提到了它.我最终在项目节点launchSettings.json下的文件中偶然发现它,Properties如下所示:

在此输入图像描述

以下是此文件的内容:

{
  "profiles": {
    "IIS Express": {
      "commandName" : "IISExpress",
      "launchBrowser": true,
      "launchUrl": "api/values",
      "environmentVariables" : {
        "ASPNET_ENV": "Development"
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

您可以更改launchURL为所需的默认路线.