liveBook · Manning

launchSettings.json

As explained in .NET in Action, Second Edition

launchSettings.json is a .NET project configuration file that defines local launch profiles and development settings such as URLs and environment variables.

launchSettings.json configures local launch profiles for .NET web services. A profile selects the project command, controls browser launching, assigns HTTP and HTTPS URLs, and supplies development environment variables. section 3.1

"profiles": {
  "AsciiArtSvc": {
    "commandName": "Project",                          #1
    "dotnetRunMessages": true,
    "launchBrowser": true,                             #2
    "applicationUrl":
      "https://localhost:7041;http://localhost:5292",  #3
    "environmentVariables": {
      "ASPNETCORE_ENVIRONMENT": "Development"
    }
  }
}

A generated profile uses commandName Project, enables browser launching, assigns HTTPS and HTTP application URLs, and sets ASPNETCORE_ENVIRONMENT to Development. section 3.1

Use the file when local development requires:

  • Changing randomly selected service ports that conflict with another application. section 3.1
  • Opening the configured URL automatically when launching through an IDE. section 3.1
  • Keeping browser-launch behavior distinct from dotnet run, which does not open a browser. section 3.1

How .NET in Action, Second Edition covers it

How deep it goes
Defines a representative profile and explains port changes and browser behavior, but does not detail the complete schema.
Examples
Uses an AsciiArtSvc profile with HTTPS and HTTP URLs, browser launching, and ASPNETCORE_ENVIRONMENT set to Development.
What it assumes
Assumes a .NET web project generated from a template and distinguishes IDE launches from dotnet run.
What you can do after
Operate/configure local web-service startup by changing ports, URLs, browser behavior, and development environment variables.
How it connects
Connects launch profiles with ASP.NET Core, HTTPS, environment variables, IDEs, and dotnet run.

Also explained in

Compare how 4 books explain launchSettings.json →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.