Even in the most empty asp.net core 2.0 / 2.1 project, there is a launchSettings.json file:

{ "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:51699", "sslPort": 44375 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "WebApplication1": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } } 

I’ve been trying to sort it out in detail, since this is quite confusing - even without taking into account the redefinition of UseUrls / Listen .

You start the project in the WebApplication mode - your browser opens https: // localhost: 5001 - but http: // localhost: 5000 also works

You start a project in IIS (Express) - either https (if a jackdaw is set) works for you, or http jackdaw is removed (which corresponds to sslPort: 0 in the config), and at the same time http + https via CreateDefaultBuilder does not work.

I read the source code , read the comments on how the default webhost is created ...

And the strange thing is that this file is not mentioned anywhere, as if it is not needed anywhere in the source code to determine the launch parameters — well, it is like a file that is used only by the studio for the application launch buttons.

Is this, or did I miss something?

My current assumption is approximately as follows: the settings from this file override the environment settings, which are passed to the type as string [] args to Main - and these settings only work when launched through the studio. At the same time, the args themselves are always empty, so apparently this is another place.

    0