Workleap.Extensions.Configuration.Substitution
1.2.11
Prefix Reserved
See the version list below for details.
dotnet add package Workleap.Extensions.Configuration.Substitution --version 1.2.11
NuGet\Install-Package Workleap.Extensions.Configuration.Substitution -Version 1.2.11
<PackageReference Include="Workleap.Extensions.Configuration.Substitution" Version="1.2.11" />
<PackageVersion Include="Workleap.Extensions.Configuration.Substitution" Version="1.2.11" />
<PackageReference Include="Workleap.Extensions.Configuration.Substitution" />
paket add Workleap.Extensions.Configuration.Substitution --version 1.2.11
#r "nuget: Workleap.Extensions.Configuration.Substitution, 1.2.11"
#:package Workleap.Extensions.Configuration.Substitution@1.2.11
#addin nuget:?package=Workleap.Extensions.Configuration.Substitution&version=1.2.11
#tool nuget:?package=Workleap.Extensions.Configuration.Substitution&version=1.2.11
Workleap.Extensions.Configuration.Substitution
This package adds variable substitution configuration provider implementation for Microsoft.Extensions.Configuration.
Getting started
dotnet add package Workleap.Extensions.Configuration.Substitution
// Example for an ASP.NET Core web application
var builder = WebApplication.CreateBuilder(args);
// Setup your configuration
builder.Configuration.AddJsonFile("appsettings.json");
builder.Configuration.AddEnvironmentVariables();
builder.Configuration.AddSubstitution(); // <-- Add this after other configuration providers
How it works
You can reference configuration values inside other configuration values by enclosing the referenced configuration key like this: ${ReferencedConfigurationKey}.
Examples
Consider this appsettings.json:
{
"Credentials": {
"Username": "alice1",
"Password": "P@ssw0rd"
},
"ConnectionString": "usr=${Credentials:Username};pwd=${Credentials:Password}"
}
Evaluating the configuration value ConnectionString would return usr=alice1;pwd=P@ssw0rd.
This also works if you're using multiple configuration providers. For instance, one could have the Credentials:Password configuration value provided by a secret from Azure Key Vault and this value would have been injected into the ConnectionString value too.
It also works with arrays:
{
"Credentials": [ "alice1", "P@ssw0rd" ],
"ConnectionString": "usr=${Credentials:0};pwd=${Credentials:1}"
}
Again, you're not limited to JSON file providers, you could use substitution with any configuration providers. It was easier to use JSON files in these examples.
Escaping values
You might not want a specific value to be substituted. In that case, escape it using double curly braces:
{
"Foo": "foo",
"Bar": "${{Foo}}"
}
Evaluating the configuration value Bar would return ${Foo}.
Exceptions
You can encounter two kinds of exceptions if your configuration is incorrect:
UnresolvedConfigurationKeyException, if you're trying to substitute a configuration value that is undefined (i.e. the key does not exist).RecursiveConfigurationKeyException, if you have many configuration values that reference each other in a recursive manner, no matter how deep the recursion is. The exception will give you details about the recursive path.
UnresolvedConfigurationKeyException can also be triggered sooner than later by using AddSubstitution(eagerValidation: true). Using eagerValidation with value true (default is false) instructs the library to check for undefined values in all the existing configuration values once, instead of checking for a particular value. This happens as soon as any configuration value is loaded.
Configuration providers order
When using .NET's IConfigurationBuilder, the order of configuration providers matters . Any configuration provider added after AddSubstitution() would not benefit from the substitution process.
License
Copyright © 2022, Workleap. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/workleap/gsoft-license/blob/master/LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
-
net8.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.28-preview.1 | 36 | 1/18/2026 |
| 1.2.27 | 1,564 | 1/18/2026 |
| 1.2.27-preview.3 | 39 | 1/17/2026 |
| 1.2.27-preview.2 | 44 | 1/16/2026 |
| 1.2.27-preview.1 | 43 | 1/12/2026 |
| 1.2.26 | 2,955 | 1/11/2026 |
| 1.2.26-preview.2 | 42 | 1/5/2026 |
| 1.2.26-preview.1 | 45 | 1/5/2026 |
| 1.2.25 | 4,018 | 1/4/2026 |
| 1.2.25-preview.2 | 48 | 12/30/2025 |
| 1.2.25-preview.1 | 48 | 12/29/2025 |
| 1.2.24 | 817 | 12/28/2025 |
| 1.2.24-preview.1 | 125 | 12/22/2025 |
| 1.2.23 | 983 | 12/21/2025 |
| 1.2.23-preview.1 | 170 | 12/15/2025 |
| 1.2.22 | 2,587 | 12/14/2025 |
| 1.2.22-preview.1 | 253 | 12/8/2025 |
| 1.2.21 | 5,055 | 12/7/2025 |
| 1.2.21-preview.1 | 448 | 12/1/2025 |
| 1.2.20 | 1,980 | 11/30/2025 |
| 1.2.20-preview.1 | 142 | 11/24/2025 |
| 1.2.19 | 2,878 | 11/23/2025 |
| 1.2.19-preview.2 | 195 | 11/22/2025 |
| 1.2.19-preview.1 | 190 | 11/16/2025 |
| 1.2.18 | 5,265 | 11/16/2025 |
| 1.2.18-preview.2 | 223 | 11/14/2025 |
| 1.2.17 | 2,035 | 11/9/2025 |
| 1.2.17-preview.1 | 153 | 11/3/2025 |
| 1.2.16 | 3,477 | 11/2/2025 |
| 1.2.16-preview.1 | 142 | 10/27/2025 |
| 1.2.15 | 1,922 | 10/26/2025 |
| 1.2.15-preview.2 | 138 | 10/21/2025 |
| 1.2.15-preview.1 | 136 | 10/20/2025 |
| 1.2.14 | 3,883 | 10/19/2025 |
| 1.2.14-preview.3 | 58 | 10/18/2025 |
| 1.2.14-preview.2 | 118 | 10/17/2025 |
| 1.2.14-preview.1 | 148 | 10/13/2025 |
| 1.2.13 | 2,419 | 10/12/2025 |
| 1.2.13-preview.2 | 143 | 10/7/2025 |
| 1.2.13-preview.1 | 139 | 10/6/2025 |
| 1.2.12 | 3,367 | 10/5/2025 |
| 1.2.12-preview.2 | 127 | 10/3/2025 |
| 1.2.12-preview.1 | 140 | 9/29/2025 |
| 1.2.11 | 2,688 | 9/28/2025 |
| 1.2.11-preview.1 | 150 | 9/23/2025 |
| 1.2.10 | 1,379 | 9/21/2025 |
| 1.2.10-preview.3 | 192 | 9/19/2025 |
| 1.2.10-preview.2 | 265 | 9/17/2025 |
| 1.2.10-preview.1 | 262 | 9/17/2025 |
| 1.2.9 | 3,075 | 9/14/2025 |
| 1.2.9-preview.2 | 130 | 9/14/2025 |
| 1.2.9-preview.1 | 140 | 9/12/2025 |
| 1.2.8 | 1,837 | 9/7/2025 |
| 1.2.8-preview.2 | 146 | 9/2/2025 |
| 1.2.8-preview.1 | 149 | 9/1/2025 |
| 1.2.7 | 1,372 | 8/31/2025 |
| 1.2.7-preview.3 | 186 | 8/27/2025 |
| 1.2.7-preview.2 | 192 | 8/26/2025 |
| 1.2.7-preview.1 | 163 | 8/25/2025 |
| 1.2.6 | 2,008 | 8/24/2025 |
| 1.2.6-preview.2 | 94 | 8/22/2025 |
| 1.2.6-preview.1 | 142 | 8/19/2025 |
| 1.2.5 | 1,904 | 8/17/2025 |
| 1.2.5-preview.1 | 148 | 8/12/2025 |
| 1.2.4 | 1,470 | 8/10/2025 |
| 1.2.4-preview.3 | 129 | 8/9/2025 |
| 1.2.4-preview.2 | 180 | 8/8/2025 |
| 1.2.4-preview.1 | 208 | 8/5/2025 |
| 1.2.3 | 10,221 | 7/30/2025 |
| 1.2.3-preview.2 | 126 | 7/30/2025 |
| 1.2.3-preview.1 | 127 | 7/29/2025 |
| 1.2.2 | 1,371 | 7/27/2025 |
| 1.2.2-preview.5 | 534 | 7/22/2025 |
| 1.2.2-preview.4 | 534 | 7/22/2025 |
| 1.2.2-preview.3 | 529 | 7/22/2025 |
| 1.2.2-preview.2 | 486 | 7/21/2025 |
| 1.2.2-preview.1 | 317 | 7/21/2025 |
| 1.2.1 | 1,486 | 7/20/2025 |
| 1.2.1-preview.2 | 142 | 7/17/2025 |
| 1.2.1-preview.1 | 135 | 7/16/2025 |
| 1.2.0 | 5,417 | 7/14/2025 |
| 1.1.20-preview.1 | 138 | 7/14/2025 |
| 1.1.19 | 8,877 | 7/13/2025 |
| 1.1.19-preview.4 | 65 | 7/12/2025 |
| 1.1.19-preview.3 | 144 | 7/10/2025 |
| 1.1.19-preview.2 | 146 | 7/10/2025 |
| 1.1.19-preview.1 | 161 | 7/8/2025 |
| 1.1.18 | 1,622 | 7/6/2025 |
| 1.1.18-preview.2 | 138 | 7/4/2025 |
| 1.1.18-preview.1 | 153 | 7/1/2025 |
| 1.1.17 | 9,551 | 6/29/2025 |
| 1.1.17-preview.2 | 139 | 6/18/2025 |
| 1.1.16 | 6,362 | 6/15/2025 |
| 1.1.16-preview.2 | 143 | 6/14/2025 |
| 1.1.16-preview.1 | 649 | 6/10/2025 |
| 1.1.15 | 2,985 | 6/8/2025 |
| 1.1.15-preview.2 | 116 | 6/8/2025 |
| 1.1.15-preview.1 | 143 | 6/3/2025 |
| 1.1.14 | 3,326 | 6/1/2025 |
| 1.1.14-preview.1 | 151 | 5/26/2025 |
| 1.1.13 | 1,084 | 5/25/2025 |
| 1.1.13-preview.3 | 126 | 5/25/2025 |
| 1.1.13-preview.2 | 109 | 5/23/2025 |
| 1.1.13-preview.1 | 143 | 5/20/2025 |
| 1.1.12 | 899 | 5/18/2025 |
| 1.1.12-preview.2 | 161 | 5/17/2025 |
| 1.1.12-preview.1 | 238 | 5/13/2025 |
| 1.1.11 | 4,864 | 5/11/2025 |
| 1.1.11-preview.1 | 145 | 5/6/2025 |
| 1.1.10 | 1,696 | 5/4/2025 |
| 1.1.10-preview.1 | 160 | 4/29/2025 |
| 1.1.9 | 401 | 4/27/2025 |
| 1.1.9-preview.2 | 146 | 4/25/2025 |
| 1.1.9-preview.1 | 159 | 4/22/2025 |
| 1.1.8-preview.1 | 3,313 | 4/14/2025 |
| 1.1.7-preview.1 | 116 | 4/11/2025 |
| 1.1.6-preview.3 | 164 | 4/7/2025 |
| 1.1.6-preview.2 | 163 | 4/1/2025 |
| 1.1.6-preview.1 | 157 | 4/1/2025 |
| 1.1.5 | 20,474 | 3/20/2025 |
| 1.1.5-preview.13 | 155 | 3/20/2025 |
| 1.1.5-preview.12 | 154 | 3/20/2025 |
| 1.1.5-preview.11 | 174 | 3/20/2025 |
| 1.1.5-preview.10 | 154 | 3/20/2025 |
| 1.1.5-preview.9 | 81 | 3/15/2025 |
| 1.1.5-preview.8 | 164 | 3/11/2025 |
| 1.1.5-preview.7 | 118 | 2/18/2025 |
| 1.1.5-preview.6 | 111 | 2/17/2025 |
| 1.1.5-preview.5 | 106 | 2/16/2025 |
| 1.1.5-preview.4 | 113 | 2/15/2025 |
| 1.1.5-preview.3 | 108 | 2/12/2025 |
| 1.1.5-preview.2 | 99 | 1/30/2025 |
| 1.1.5-preview.1 | 102 | 1/24/2025 |
| 1.1.4 | 48,415 | 1/21/2025 |
| 1.1.4-preview.16 | 122 | 1/17/2025 |
| 1.1.4-preview.15 | 93 | 1/13/2025 |
| 1.1.4-preview.13 | 103 | 12/18/2024 |
| 1.1.4-preview.12 | 645 | 11/29/2024 |
| 1.1.4-preview.11 | 110 | 11/24/2024 |
| 1.1.4-preview.10 | 94 | 11/16/2024 |
| 1.1.4-preview.9 | 100 | 10/31/2024 |
| 1.1.4-preview.8 | 101 | 10/30/2024 |
| 1.1.4-preview.7 | 106 | 10/28/2024 |
| 1.1.4-preview.6 | 105 | 10/28/2024 |
| 1.1.4-preview.5 | 103 | 10/28/2024 |
| 1.1.4-preview.4 | 94 | 10/7/2024 |
| 1.1.4-preview.3 | 103 | 10/1/2024 |
| 1.1.4-preview.2 | 107 | 9/30/2024 |
| 1.1.4-preview.1 | 103 | 9/27/2024 |
| 1.1.3 | 60,618 | 9/23/2024 |
| 1.1.3-preview.48 | 109 | 9/20/2024 |
| 1.1.3-preview.47 | 105 | 9/13/2024 |
| 1.1.3-preview.46 | 104 | 8/27/2024 |
| 1.1.3-preview.45 | 105 | 8/27/2024 |
| 1.1.3-preview.44 | 98 | 8/27/2024 |
| 1.1.3-preview.43 | 98 | 8/27/2024 |
| 1.1.3-preview.42 | 121 | 8/16/2024 |
| 1.1.3-preview.41 | 102 | 7/30/2024 |
| 1.1.3-preview.40 | 151 | 7/18/2024 |
| 1.1.3-preview.39 | 107 | 7/18/2024 |
| 1.1.3-preview.38 | 106 | 7/5/2024 |
| 1.1.3-preview.37 | 108 | 5/31/2024 |
| 1.1.3-preview.36 | 125 | 5/31/2024 |
| 1.1.3-preview.35 | 102 | 5/21/2024 |
| 1.1.3-preview.34 | 114 | 5/10/2024 |
| 1.1.3-preview.33 | 107 | 5/3/2024 |
| 1.1.3-preview.32 | 172 | 4/15/2024 |
| 1.1.3-preview.31 | 117 | 4/12/2024 |
| 1.1.3-preview.30 | 143 | 4/3/2024 |
| 1.1.3-preview.29 | 121 | 4/3/2024 |
| 1.1.3-preview.28 | 140 | 3/8/2024 |
| 1.1.3-preview.27 | 133 | 3/7/2024 |
| 1.1.3-preview.26 | 120 | 3/4/2024 |
| 1.1.3-preview.25 | 120 | 3/1/2024 |
| 1.1.3-preview.24 | 129 | 2/16/2024 |
| 1.1.3-preview.23 | 117 | 2/12/2024 |
| 1.1.3-preview.22 | 129 | 2/6/2024 |
| 1.1.3-preview.21 | 109 | 2/6/2024 |
| 1.1.3-preview.20 | 126 | 1/22/2024 |
| 1.1.3-preview.19 | 112 | 1/12/2024 |
| 1.1.3-preview.18 | 110 | 1/12/2024 |
| 1.1.3-preview.17 | 106 | 1/12/2024 |
| 1.1.3-preview.16 | 126 | 12/18/2023 |
| 1.1.3-preview.15 | 148 | 11/26/2023 |
| 1.1.3-preview.14 | 131 | 11/17/2023 |
| 1.1.3-preview.13 | 114 | 11/13/2023 |
| 1.1.3-preview.12 | 225 | 11/6/2023 |
| 1.1.3-preview.11 | 134 | 10/30/2023 |
| 1.1.3-preview.10 | 129 | 10/20/2023 |
| 1.1.3-preview.9 | 140 | 10/17/2023 |
| 1.1.3-preview.8 | 156 | 10/13/2023 |
| 1.1.3-preview.7 | 135 | 9/26/2023 |
| 1.1.3-preview.6 | 127 | 9/25/2023 |
| 1.1.3-preview.5 | 123 | 9/21/2023 |
| 1.1.3-preview.4 | 128 | 9/20/2023 |
| 1.1.3-preview.3 | 138 | 9/20/2023 |
| 1.1.3-preview.2 | 164 | 9/20/2023 |
| 1.1.3-preview.1 | 162 | 8/9/2023 |
| 1.1.2 | 154,039 | 7/20/2023 |
| 1.1.2-preview.20 | 189 | 7/20/2023 |