51

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?

1 Answer 1

76

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:

enter image description here

Here are the contents of this file:

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

You can change the launchURL to your desired default route.

Sign up to request clarification or add additional context in comments.

3 Comments

Adding this to the specific application launch settings I'm using worked e.g. I have profiles a different profile under profiles that I use.
For any Blazor users, make sure you're editing the correct launchSettings file. There is one for the Client and Server projects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.