I have an API website. Here is my launchSettings.json.
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:40682",
"sslPort": 44360
}
},
"profiles": {
"TTRailtrax": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:7184;http://localhost:5184",
"dotnetRunMessages": true
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
When I run this project, the URL used is https://localhost:44360.
But when I check out my code on a different computer and run the project, the URL is https://localhost:7184.
I the URL to be the same on all computers because this API is called from another website in the solution.
I can see the second URL is coming from the TTRailtrax profile, but I don't really understand what these profiles are, or why different computers seems to be choosing different ones. I have confirmed launchSettings.json is checked into source control and is the same on both computers.
Update
Here's what I've learned so far. The two profiles are created by default. One of them (TTRailtrax) will use the Kestral server. The other (IIS Express) will use IIS Express. I'm not sure why there are two servers or what are the considerations when choosing between them.
Microsoft's documentation shows a dropdown where you can select which profile is being used. I cannot find this anywhere on my system (Visual Studio 2022).
If I go into the project's settings and open the debug launch profiles UI, I can edit the App URL field. However, the App SSL URL field is disabled. (I am using SSL.)
I have not figured out why one of my computers is selecting one profile while the other computer selected the other profile.