ASP.NET Core 默认调试启动 URL [英] ASP.NET Core Default debugging launch URL

查看:43
本文介绍了ASP.NET Core 默认调试启动 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When using the ASP.NET Core Web API template, the default debugging start up URL is somehow set to api/values. Where is this default configured and how do I change it?

推荐答案

关于此启动 URL 的声明位置,我能找到的文档非常少.在这个 博客文章 在 MSDN 上.我最终在项目的 Properties 节点下的 launchSettings.json 文件中偶然发现了它,如下所示:

There was very little documentation that I could find regarding where this start up URL was declared. There is a brief mention of it in this blog post on MSDN. I eventually stumbled upon it in the launchSettings.json file under the Properties node of the project as shown below:

这里是这个文件的内容:

Here are the contents of this file:

{
  "profiles": {
    "IIS Express": {
      "commandName" : "IISExpress",
      "launchBrowser": true,
      "launchUrl": "api/values",
      "environmentVariables" : {
        "ASPNET_ENV": "Development"
      }
    }
  }
}

您可以将 launchURL 更改为您想要的默认路由.

You can change the launchURL to your desired default route.

这篇关于ASP.NET Core 默认调试启动 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆