---
source: https://iinventedlight.com/library/notes/dotnet-configuration.md
title: "Configuration and configuration providers in .NET"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (dotnet/docs); prose restates or closely paraphrases cited source lines"
license_family: dotnet-docs-ccby
rule_check: "needs rule check (family not in auto-publish rule; check.mjs auto-approves only usgov and arxiv-ccby)"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn (.NET docs), Configuration - .NET, CC BY 4.0 (dotnet/docs); Microsoft Learn (.NET docs), Configuration providers - .NET, CC BY 4.0 (dotnet/docs)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: .NET"
tags: ['dotnet', 'configuration', 'csharp']
sources:
  - id: S1
    title: "Configuration - .NET"
    publisher: Microsoft Learn (.NET docs)
    url: https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration
    accessed: 2026-11-04
    license: "CC BY 4.0 (dotnet/docs)"
  - id: S2
    title: "Configuration providers - .NET"
    publisher: Microsoft Learn (.NET docs)
    url: https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration-providers
    accessed: 2026-11-04
    license: "CC BY 4.0 (dotnet/docs)"
---
# Configuration and configuration providers in .NET

**Answer:** Configuration in .NET is performed using one or more configuration providers. Given one or more configuration sources, the IConfiguration type provides a unified view of the configuration data. (S1)

## Basics

- Configuration is read-only, and the configuration pattern isn't designed to be programmatically writable. (S1)
- .NET console apps created using the dotnet new command template or Visual Studio by default don't expose configuration capabilities. (S1)
- To add configuration in a new .NET console application, add a package reference to Microsoft.Extensions.Configuration. (S1)

## Providers

- Several types of providers rely on various configuration sources. (S2)
- FileConfigurationProvider is the base class for loading configuration from the file system. (S2)
- The JsonConfigurationProvider class loads configuration from a JSON file. (S2)
- All of the file configuration providers throw the FormatException when duplicate keys are found in a single provider. (S2)

## Claims
- id: C1
  claim: Configuration uses providers.
  source: S1
  evidence: "Configuration in .NET is performed using one or more configuration providers."
- id: C2
  claim: Configuration is read-only.
  source: S1
  evidence: "Configuration is read-only"
- id: C3
  claim: JsonConfigurationProvider reads JSON.
  source: S2
  evidence: "The JsonConfigurationProvider class loads configuration from a JSON file."
- id: C4
  claim: Duplicate keys throw FormatException.
  source: S2
  evidence: "When keys are found by multiple providers"

## Sources
- [S1] Configuration - .NET. Microsoft Learn (.NET docs). https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration . License: CC BY 4.0 (dotnet/docs). Accessed 2026-11-04.
- [S2] Configuration providers - .NET. Microsoft Learn (.NET docs). https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration-providers . License: CC BY 4.0 (dotnet/docs). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
