ASP.NET Core Interview Question #41

What is launchSettings.json?

Application Structure & Configuration Junior Beginner

Quick Interview Answer

launchSettings.json contains local launch profiles used by development tools such as Visual Studio and dotnet run. It can define application URLs, environment variables, launch behavior, and profiles for IIS Express or the project.

Detailed Explanation

launchSettings.json contains local launch profiles used by development tools such as Visual Studio and dotnet run. It can define application URLs, environment variables, launch behavior, and profiles for IIS Express or the project.

The file is intended for local development and is not used to configure a deployed ASP.NET Core application in production.

A common setting is ASPNETCORE_ENVIRONMENT=Development, which causes the application to load development-specific behavior and configuration.

Code Example

{
  "profiles": {
    "MyApp": {
      "commandName": "Project",
      "launchBrowser": true,
      "applicationUrl": "https://localhost:7001;http://localhost:5001",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}