The Properties/launchSettings.json file holds settings for starting an ASP.NET Core application. Its launch profiles specify listening URLs, environment variables, and whether to open a browser. Edit it when you need a predictable local port or startup environment. section 15.2.5 section 32.1
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:5000",
"sslPort": 0
}
},
"profiles": {
"Platform": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Compare the project profile with IIS Express: each has its own settings. For dotnet run, change the project profile’s applicationUrl; changing only iisSettings will not set that command’s port. section 15.2.5 section 2.3
For a local run:
- Set the project profile’s applicationUrl to http://localhost:5000, run dotnet run from the project folder, then request that URL in a browser. section 2.3
- Set ASPNETCORE_ENVIRONMENT under environmentVariables when you need a different environment. Development selects appsettings.Development.json during startup; the setting can also be inspected through application configuration. section 15.2.5
- To listen on HTTP and HTTPS, use an applicationUrl such as http://localhost:5000;https://localhost:5500. Separate URLs with a semicolon and no spaces; the HTTPS example also regenerates and trusts a development certificate. section 16.4.1
Watch which launcher you use. IIS Express has separate settings, while a Visual Studio Code launch configuration sets ASPNETCORE_ENVIRONMENT in .vscode/launch.json. If an environment change appears ineffective, check the configuration used to start the application. section 15.2.5



