Skip to main content

16 posts tagged with "Configuration"

Application Configuration and Settings Management

View All Tags

How to Pin the .NET SDK Version with global.json in a .NET C# Project

· 10 min read
Jagdish Kumawat
Founder @ Dewiride

By default, every dotnet command uses the newest .NET SDK on the computer. That's fine until a teammate or a build server has a different one, and the same project starts behaving differently. A global.json file at the root of your repository settles which SDK the project uses. This guide creates one with .NET 10, then tries every rollForward value against the real SDK installed on this computer, so you can see which ones pass and which fail before you choose.

How to Connect a .NET C# Web API to a MySQL Database — Part 1: Connect with EF Core and a Secure Connection String

· 42 min read
Jagdish Kumawat
Founder @ Dewiride

A Web API needs somewhere to keep its data, and MySQL is one of the most popular places to keep it. This part connects an ASP.NET Core minimal API, written in .NET 10 and C#, to MySQL 9.7 through Entity Framework Core. It keeps the password out of the code, encrypts the connection, proves the connection works with a health check, and then looks at that same connection from inside MySQL so you can see exactly what happened.

How to Store a Connection String in .NET C# with dotnet user-secrets

· 12 min read
Jagdish Kumawat
Founder @ Dewiride

A connection string usually contains a password, and appsettings.json is committed to Git with the rest of your code. .NET's Secret Manager, the dotnet user-secrets command, keeps secrets in a file in your user profile instead, and ASP.NET Core reads them as if they were in appsettings.json. This guide stores a MySQL connection string that way, shows every command with its real output, and explains how the same setting reaches the app outside development.

How to Keep Passwords Out of compose.yaml with an .env File

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

A password typed into compose.yaml ends up in Git, and then in every copy of the repository. Docker Compose can read passwords from a separate .env file instead, and with one small piece of syntax it refuses to start when they're missing. This guide sets that up for a MySQL container, with the real output of every check.

How to Run Code Only in Development in ASP.NET Core

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

Some code belongs only on a developer's machine: an in-memory store, a relaxed setting, a debugging aid. ASP.NET Core knows which environment it runs in, and one if around builder.Environment.IsDevelopment() keeps that code out of everywhere else. This guide shows the check, where to put it, and how to try the other branch on your own machine.

How to Read from appsettings.json in ASP.NET Core (C#)

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

appsettings.json is where an ASP.NET Core app keeps its settings — connection strings, API base URLs, feature flags, timeouts. Reading those values comes down to one service, IConfiguration, which ASP.NET Core registers for you. In a console app you build the same thing yourself in a few lines.

This guide covers both, on .NET 10.

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.