---
title: "Comment by Kazys Račkauskas on \"Understanding LaunchSettings.json in ASP.NET Core: A Comprehensive Guide\" | Hashnode"
description: "I don't work much with ASP.NET, and when I do, I usually stick to the default settings in launchSettings.json. So, it was nice to get more familiar with launchS"
url: "https://hashnode.com/posts/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide/66c80e034164fe475e685201/comment/66cef334659ca38d03dff662"
---

[Discussion](https://hashnode.com/posts/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide/66c80e034164fe475e685201)

Comment [Understanding LaunchSettings.json in ASP.NET Core: A Comprehensive Guide](https://hashnode.com/posts/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide/66c80e034164fe475e685201)

[Kazys Račkauskas](https://hashnode.com/@EasyTdd)

[Aug 28, 2024](https://hashnode.com/posts/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide/66c80e034164fe475e685201/comment/66cef334659ca38d03dff662)

I don't work much with ASP.NET, and when I do, I usually stick to the default settings in launchSettings.json. So, it was nice to get more familiar with launchSettings.json through your article. One question: How is the switch between profiles made? How does the runtime know which profile to use?

[Ujjwal Singh](https://hashnode.com/@Ujjwal087)

[Aug 29, 2024](https://hashnode.com/posts/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide/66c80e034164fe475e685201/comment/66cef334659ca38d03dff662#reply-66cff9b7ae7f42399de76e32)

Hi Kazys! Good to hear from you.

In an ASP.NET Core application, the runtime selects the environment (Development, Staging, Production, etc.) based on the ASPNETCORE\_ENVIRONMENT environment variable. Here's how it works:

Environment Variable Setting:

Each profile in launchSettings.json sets the ASPNETCORE\_ENVIRONMENT variable (e.g., "Development").

Runtime Selection: When the application starts, the runtime reads ASPNETCORE\_ENVIRONMENT to determine which environment-specific configuration to load, such as appsettings.Development.json.

Switching Profiles: Locally: In Visual Studio, switch profiles using the dropdown to set the environment variable. Its located near the start button where you can select IIS Express or your project name.

Deployment: On servers or in cloud environments, set the ASPNETCORE\_ENVIRONMENT variable to control the environment. This setup ensures the application loads the correct configuration and services based on the environment it's running in.

[Kazys Račkauskas](https://hashnode.com/@EasyTdd)

[Aug 29, 2024](https://hashnode.com/posts/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide/66c80e034164fe475e685201/comment/66cef334659ca38d03dff662#reply-66d02a1fcaf76c56630118fb)

[Ujjwal Singh](https://hashnode.com/@Ujjwal087) now it is more clear, thank you!
