问题描述
在使用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的声明位置,我几乎找不到文档.在博客文章.我最终在项目的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:
以下是此文件的内容:
{
"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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!