---
title: "Discussion on \"Understanding LaunchSettings.json in ASP.NET Core: A Comprehensive Guide\" | Hashnode"
description: "Discussion on \"Understanding LaunchSettings.json in ASP.NET Core: A Comprehensive Guide\". Understanding LaunchSettings.json in ASP.NET Core: A Comprehensive Guide"
url: "https://hashnode.com/posts/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide/66c80e034164fe475e685201"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Understanding LaunchSettings.json in ASP.NET Core: A Comprehensive Guide](https://ujjwal-ghatani-dev.hashnode.dev/understanding-launchsettingsjson-in-aspnet-core-a-comprehensive-guide?utm_source=hashnode&utm_medium=feed)

Understanding LaunchSettings.json in ASP.NET Core: A Comprehensive Guide

Aug 23, 2024 · 3 min read · ujjwal-ghatani-dev.hashnode.dev  
Read the article

-   [#aspnet-core](https://hashnode.com/tag/aspnet-core)
-   [#dotnet](https://hashnode.com/tag/dotnet)
-   [#dotnetcore](https://hashnode.com/tag/dotnetcore)
-   [#apis](https://hashnode.com/tag/apis)
-   [#coding](https://hashnode.com/tag/coding)
-   [#concepts](https://hashnode.com/tag/concepts)
-   [#dotnet8](https://hashnode.com/tag/dotnet8)
-   [#dotnet6](https://hashnode.com/tag/dotnet6)
-   [#dotnet7](https://hashnode.com/tag/dotnet7)
-   [#csharp](https://hashnode.com/tag/csharp)
-   [#json](https://hashnode.com/tag/json)

## Written by

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

@Ujjwal087 · India

  
[View profile](https://hashnode.com/@Ujjwal087)

Crafting clean code and clear thoughts—one blog at a time 🛠️💡

👋 Hi, I'm Ujjwal Singh! I'm a software engineer and team lead with 10 years of expertise in .NET technologies. Over the years, I've built a solid foundation in crafting robust solutions and leading teams. While my core strength lies in .NET, I'm also deeply interested in DevOps and eager to explore how it can enhance software delivery. I’m passionate about continuous learning, sharing knowledge, and connecting with others who love technology. Let’s build and innovate together!

## Responses 1

Markdown supported · ⌘↵ to post

[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!
