launchSettings.json is the local launch configuration for an ASP.NET Core project. Stored in /Properties/, it controls how the board-game API starts during development; it is not deployed to production. section 2.4.1 section 2.4
The file organizes launch behavior around three main areas:
- $schema identifies the JSON schema used to describe the file. section 2.4.1
- iisSettings provides base settings for IIS Express, including local HTTP and HTTPS ports. section 2.4.1
- profiles defines selectable launch configurations such as IIS Express and the MyBGList Kestrel profile. section 2.4.1
- A profile can select the command, browser launch behavior, starting URL, application URLs, and ASPNETCORE_ENVIRONMENT value. section 2.4.1 section 2.5.1
Prepare a tester profile
For the board-game API, configure the Kestrel profile to use TCP port 55221 for HTTP and 55222 for HTTPS, set ASPNETCORE_ENVIRONMENT to Staging, and open the BoardGamesController.Get() route when the application starts. Leave IIS Express unchanged when testers will not use it. section 2.5.1
Listing 2.1 Modified launchSettings.json file
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:40080", #1
"sslPort": 40443 #1
}
},
"profiles": {
"MyBGList": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger", #2
"applicationUrl": "https://localhost:40443;http://localhost:40080", #3
"environmentVariables": { #4
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger", #5
"environmentVariables": { #6
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Use the modified launchSettings.json listing to inspect a complete profile with HTTPS and HTTP application URLs, automatic browser launch, a Swagger starting URL, and a Development environment variable. section 2.4.1
Choose a profile from Visual Studio’s Start control, then run the application and verify that the selected ports and starting endpoint behave as configured. The environment value also affects middleware: Development enables the developer exception page, while changing the environment can exercise production-style exception handling. section 2.4.1 section 2.4.3



