Skip to content

Commit 0c14a05

Browse files
authored
Add note about order of config providers. (#27941)
1 parent 52dcfa5 commit 0c14a05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/core/extensions/configuration-providers.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Configuration providers in .NET
33
description: Learn how the Configuration provider API is used to configure .NET applications.
44
author: IEvangelist
55
ms.author: dapine
6-
ms.date: 01/06/2022
6+
ms.date: 01/24/2022
77
ms.topic: reference
88
---
99

@@ -45,7 +45,8 @@ The preceding code:
4545
- `optional: true`: The file is optional.
4646
- `reloadOnChange: true`: The file is reloaded when changes are saved.
4747

48-
The JSON settings are overridden by settings in the [Environment variables configuration provider](#environment-variable-configuration-provider) and the [Command-line configuration provider](#command-line-configuration-provider).
48+
> [!IMPORTANT]
49+
> When adding configuration providers to a builder using <xref:Microsoft.Extensions.Configuration.IConfigurationBuilder.Add%2A?displayProperty=nameWithType>, the order in which providers are added matters. Earlier configuration providers are overridden by configuration providers added later.
4950
5051
An example *appsettings.json* file with various configuration settings follows:
5152

0 commit comments

Comments
 (0)