Using launchSettings.json

Alternately, you can define your application's listening URLs using the launchSettings.json file. This file allows you to specify behavior based on the specific environment your application is deployed under. Launch profiles can be customized based on the web server hosting your application (IIS Express, or Kestrel, which is defined as a profile under your project's name when you first create a project using the CLI).

When you launch your application with the dotnet run command, .NET will look for a launchSettings.json file, then search for the first profile whose commandName parameter has a value of "Project", which will use the Kestrel web server. From within this profile, you can set environment variables that ...

Get Hands-On Network Programming with C# and .NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.