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. Show activity on this post. Go to the Solution Explorer, find launchSettings. json file and modify the "launchUrl" property and set it to whatever you want.
Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.
Production is the default value if DOTNET_ENVIRONMENT and ASPNETCORE_ENVIRONMENT have not been set. Apps deployed to Azure are Production by default. To set the environment in an Azure App Service app by using the portal: Select the app from the App Services page.
UseEndpoints adds endpoint execution to the middleware pipeline. It runs the delegate associated with the selected endpoint.
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" } } } }
You can change the launchURL
to your desired default route.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With