Click here to Skip to main content
15,878,748 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
title says it all, when I launch my site from VS the url set in /Properties/launchSettings.json is used but the file isn't shipped to production, however, I notice whatever url that was in launchSettings.json is used when the site is launched in Production so I figure it must be in some config file somewhere.
I launch the site in a Linux systemd service which translates to
/usr/bin/dotnet /var/www/CommandsWebsite/CommandsWebsite.dll

What I have tried:

Looking on my server for a config file containing a url
Updated 20-Jun-23 19:18pm

1 solution

First off, launchSettings.json file is only used within the local development machine. Refer: ASP.NET Core launchSettings.json File - Dot Net Tutorials[^]

Now, to setup a startup page for ASP.NET Core webapp, there are various ways:
1. Method 1: Set Startup Class
2. Method 2: Configure the Startup.cs file
3. Method 3: Use the UseDefaultFiles Method

First two are custom ways. Generally, apps use default configuration (Method 3) where one of the below files is placed in wwwroot and setup to use it.

How to set start page in dotnet core web api? - StackTuts[^]
Configuring Startup Page In ASP.NET Core[^]
Share this answer
pkfox 21-Jun-23 2:53am    
Thanks Sandeep I would like to be able to change the startup page without modifying the source code if possible.
Richard Deeming 21-Jun-23 3:39am    
You should be able to read some settings from the configuration and use those to configure the routes. But there are so many different ways to configure the routing these days that it's almost impossible to answer without seeing how you've set up the routing at the moment.

For example, you might have a UseEndpoints call configuring the routes. You might have a UseMvc call configuring the routes. You might be using attribute-based routing. You might be using "minimal APIs".

Each new version adds at least twelvelty new ways of configuring the mapping between the request and the code that handles it, along with hundreds of articles explain "why Option X is The One True Way and all other options suck balls" for each of the new options.
pkfox 21-Jun-23 3:47am    
Point taken, I share your views but thought I'd ask the question - thanks Richard

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900