Workleap.Extensions.Configuration.Substitution
1.2.23
Prefix Reserved
See the version list below for details.
dotnet add package Workleap.Extensions.Configuration.Substitution --version 1.2.23
NuGet\Install-Package Workleap.Extensions.Configuration.Substitution -Version 1.2.23
<PackageReference Include="Workleap.Extensions.Configuration.Substitution" Version="1.2.23" />
<PackageVersion Include="Workleap.Extensions.Configuration.Substitution" Version="1.2.23" />
<PackageReference Include="Workleap.Extensions.Configuration.Substitution" />
paket add Workleap.Extensions.Configuration.Substitution --version 1.2.23
#r "nuget: Workleap.Extensions.Configuration.Substitution, 1.2.23"
#:package Workleap.Extensions.Configuration.Substitution@1.2.23
#addin nuget:?package=Workleap.Extensions.Configuration.Substitution&version=1.2.23
#tool nuget:?package=Workleap.Extensions.Configuration.Substitution&version=1.2.23
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.24-preview.1 | 35 | 12/22/2025 |
| 1.2.23 | 266 | 12/21/2025 |
| 1.2.23-preview.1 | 160 | 12/15/2025 |
| 1.2.22 | 1,687 | 12/14/2025 |
| 1.2.22-preview.1 | 239 | 12/8/2025 |
| 1.2.21 | 2,150 | 12/7/2025 |
| 1.2.21-preview.1 | 436 | 12/1/2025 |
| 1.2.20 | 1,942 | 11/30/2025 |
| 1.2.20-preview.1 | 135 | 11/24/2025 |
| 1.2.19 | 2,368 | 11/23/2025 |
| 1.2.19-preview.2 | 185 | 11/22/2025 |
| 1.2.19-preview.1 | 179 | 11/16/2025 |
| 1.2.18 | 3,824 | 11/16/2025 |
| 1.2.18-preview.2 | 214 | 11/14/2025 |
| 1.2.17 | 1,471 | 11/9/2025 |
| 1.2.17-preview.1 | 144 | 11/3/2025 |
| 1.2.16 | 2,919 | 11/2/2025 |
| 1.2.16-preview.1 | 131 | 10/27/2025 |
| 1.2.15 | 1,806 | 10/26/2025 |
| 1.2.15-preview.2 | 128 | 10/21/2025 |
| 1.2.15-preview.1 | 127 | 10/20/2025 |
| 1.2.14 | 3,299 | 10/19/2025 |
| 1.2.14-preview.3 | 50 | 10/18/2025 |
| 1.2.14-preview.2 | 109 | 10/17/2025 |
| 1.2.14-preview.1 | 136 | 10/13/2025 |
| 1.2.13 | 2,305 | 10/12/2025 |
| 1.2.13-preview.2 | 130 | 10/7/2025 |
| 1.2.13-preview.1 | 130 | 10/6/2025 |
| 1.2.12 | 3,097 | 10/5/2025 |
| 1.2.12-preview.2 | 120 | 10/3/2025 |
| 1.2.12-preview.1 | 131 | 9/29/2025 |
| 1.2.11 | 2,238 | 9/28/2025 |
| 1.2.11-preview.1 | 141 | 9/23/2025 |
| 1.2.10 | 1,314 | 9/21/2025 |
| 1.2.10-preview.3 | 184 | 9/19/2025 |
| 1.2.10-preview.2 | 255 | 9/17/2025 |
| 1.2.10-preview.1 | 252 | 9/17/2025 |
| 1.2.9 | 3,059 | 9/14/2025 |
| 1.2.9-preview.2 | 116 | 9/14/2025 |
| 1.2.9-preview.1 | 127 | 9/12/2025 |
| 1.2.8 | 1,629 | 9/7/2025 |
| 1.2.8-preview.2 | 138 | 9/2/2025 |
| 1.2.8-preview.1 | 141 | 9/1/2025 |
| 1.2.7 | 1,365 | 8/31/2025 |
| 1.2.7-preview.3 | 182 | 8/27/2025 |
| 1.2.7-preview.2 | 178 | 8/26/2025 |
| 1.2.7-preview.1 | 153 | 8/25/2025 |
| 1.2.6 | 1,937 | 8/24/2025 |
| 1.2.6-preview.2 | 87 | 8/22/2025 |
| 1.2.6-preview.1 | 131 | 8/19/2025 |
| 1.2.5 | 1,892 | 8/17/2025 |
| 1.2.5-preview.1 | 137 | 8/12/2025 |
| 1.2.4 | 1,461 | 8/10/2025 |
| 1.2.4-preview.3 | 118 | 8/9/2025 |
| 1.2.4-preview.2 | 169 | 8/8/2025 |
| 1.2.4-preview.1 | 200 | 8/5/2025 |
| 1.2.3 | 8,405 | 7/30/2025 |
| 1.2.3-preview.2 | 119 | 7/30/2025 |
| 1.2.3-preview.1 | 117 | 7/29/2025 |
| 1.2.2 | 1,359 | 7/27/2025 |
| 1.2.2-preview.5 | 525 | 7/22/2025 |
| 1.2.2-preview.4 | 524 | 7/22/2025 |
| 1.2.2-preview.3 | 514 | 7/22/2025 |
| 1.2.2-preview.2 | 477 | 7/21/2025 |
| 1.2.2-preview.1 | 308 | 7/21/2025 |
| 1.2.1 | 1,476 | 7/20/2025 |
| 1.2.1-preview.2 | 130 | 7/17/2025 |
| 1.2.1-preview.1 | 127 | 7/16/2025 |
| 1.2.0 | 5,234 | 7/14/2025 |
| 1.1.20-preview.1 | 132 | 7/14/2025 |
| 1.1.19 | 5,519 | 7/13/2025 |
| 1.1.19-preview.4 | 57 | 7/12/2025 |
| 1.1.19-preview.3 | 136 | 7/10/2025 |
| 1.1.19-preview.2 | 143 | 7/10/2025 |
| 1.1.19-preview.1 | 152 | 7/8/2025 |
| 1.1.18 | 1,614 | 7/6/2025 |
| 1.1.18-preview.2 | 127 | 7/4/2025 |
| 1.1.18-preview.1 | 142 | 7/1/2025 |
| 1.1.17 | 8,474 | 6/29/2025 |
| 1.1.17-preview.2 | 134 | 6/18/2025 |
| 1.1.16 | 5,101 | 6/15/2025 |
| 1.1.16-preview.2 | 134 | 6/14/2025 |
| 1.1.16-preview.1 | 588 | 6/10/2025 |
| 1.1.15 | 2,627 | 6/8/2025 |
| 1.1.15-preview.2 | 110 | 6/8/2025 |
| 1.1.15-preview.1 | 135 | 6/3/2025 |
| 1.1.14 | 3,127 | 6/1/2025 |
| 1.1.14-preview.1 | 140 | 5/26/2025 |
| 1.1.13 | 1,047 | 5/25/2025 |
| 1.1.13-preview.3 | 116 | 5/25/2025 |
| 1.1.13-preview.2 | 100 | 5/23/2025 |
| 1.1.13-preview.1 | 138 | 5/20/2025 |
| 1.1.12 | 768 | 5/18/2025 |
| 1.1.12-preview.2 | 151 | 5/17/2025 |
| 1.1.12-preview.1 | 231 | 5/13/2025 |
| 1.1.11 | 4,636 | 5/11/2025 |
| 1.1.11-preview.1 | 137 | 5/6/2025 |
| 1.1.10 | 1,624 | 5/4/2025 |
| 1.1.10-preview.1 | 150 | 4/29/2025 |
| 1.1.9 | 393 | 4/27/2025 |
| 1.1.9-preview.2 | 138 | 4/25/2025 |
| 1.1.9-preview.1 | 152 | 4/22/2025 |
| 1.1.8-preview.1 | 2,922 | 4/14/2025 |
| 1.1.7-preview.1 | 109 | 4/11/2025 |
| 1.1.6-preview.3 | 156 | 4/7/2025 |
| 1.1.6-preview.2 | 154 | 4/1/2025 |
| 1.1.6-preview.1 | 150 | 4/1/2025 |
| 1.1.5 | 17,752 | 3/20/2025 |
| 1.1.5-preview.13 | 148 | 3/20/2025 |
| 1.1.5-preview.12 | 147 | 3/20/2025 |
| 1.1.5-preview.11 | 170 | 3/20/2025 |
| 1.1.5-preview.10 | 147 | 3/20/2025 |
| 1.1.5-preview.9 | 70 | 3/15/2025 |
| 1.1.5-preview.8 | 156 | 3/11/2025 |
| 1.1.5-preview.7 | 111 | 2/18/2025 |
| 1.1.5-preview.6 | 99 | 2/17/2025 |
| 1.1.5-preview.5 | 96 | 2/16/2025 |
| 1.1.5-preview.4 | 104 | 2/15/2025 |
| 1.1.5-preview.3 | 96 | 2/12/2025 |
| 1.1.5-preview.2 | 93 | 1/30/2025 |
| 1.1.5-preview.1 | 95 | 1/24/2025 |
| 1.1.4 | 46,527 | 1/21/2025 |
| 1.1.4-preview.16 | 110 | 1/17/2025 |
| 1.1.4-preview.15 | 86 | 1/13/2025 |
| 1.1.4-preview.13 | 99 | 12/18/2024 |
| 1.1.4-preview.12 | 619 | 11/29/2024 |
| 1.1.4-preview.11 | 102 | 11/24/2024 |
| 1.1.4-preview.10 | 88 | 11/16/2024 |
| 1.1.4-preview.9 | 94 | 10/31/2024 |
| 1.1.4-preview.8 | 95 | 10/30/2024 |
| 1.1.4-preview.7 | 97 | 10/28/2024 |
| 1.1.4-preview.6 | 95 | 10/28/2024 |
| 1.1.4-preview.5 | 94 | 10/28/2024 |
| 1.1.4-preview.4 | 89 | 10/7/2024 |
| 1.1.4-preview.3 | 95 | 10/1/2024 |
| 1.1.4-preview.2 | 95 | 9/30/2024 |
| 1.1.4-preview.1 | 99 | 9/27/2024 |
| 1.1.3 | 59,420 | 9/23/2024 |
| 1.1.3-preview.48 | 101 | 9/20/2024 |
| 1.1.3-preview.47 | 95 | 9/13/2024 |
| 1.1.3-preview.46 | 95 | 8/27/2024 |
| 1.1.3-preview.45 | 99 | 8/27/2024 |
| 1.1.3-preview.44 | 92 | 8/27/2024 |
| 1.1.3-preview.43 | 90 | 8/27/2024 |
| 1.1.3-preview.42 | 112 | 8/16/2024 |
| 1.1.3-preview.41 | 91 | 7/30/2024 |
| 1.1.3-preview.40 | 143 | 7/18/2024 |
| 1.1.3-preview.39 | 100 | 7/18/2024 |
| 1.1.3-preview.38 | 91 | 7/5/2024 |
| 1.1.3-preview.37 | 98 | 5/31/2024 |
| 1.1.3-preview.36 | 120 | 5/31/2024 |
| 1.1.3-preview.35 | 95 | 5/21/2024 |
| 1.1.3-preview.34 | 107 | 5/10/2024 |
| 1.1.3-preview.33 | 101 | 5/3/2024 |
| 1.1.3-preview.32 | 160 | 4/15/2024 |
| 1.1.3-preview.31 | 111 | 4/12/2024 |
| 1.1.3-preview.30 | 137 | 4/3/2024 |
| 1.1.3-preview.29 | 111 | 4/3/2024 |
| 1.1.3-preview.28 | 133 | 3/8/2024 |
| 1.1.3-preview.27 | 124 | 3/7/2024 |
| 1.1.3-preview.26 | 111 | 3/4/2024 |
| 1.1.3-preview.25 | 110 | 3/1/2024 |
| 1.1.3-preview.24 | 117 | 2/16/2024 |
| 1.1.3-preview.23 | 106 | 2/12/2024 |
| 1.1.3-preview.22 | 121 | 2/6/2024 |
| 1.1.3-preview.21 | 103 | 2/6/2024 |
| 1.1.3-preview.20 | 119 | 1/22/2024 |
| 1.1.3-preview.19 | 104 | 1/12/2024 |
| 1.1.3-preview.18 | 99 | 1/12/2024 |
| 1.1.3-preview.17 | 97 | 1/12/2024 |
| 1.1.3-preview.16 | 119 | 12/18/2023 |
| 1.1.3-preview.15 | 136 | 11/26/2023 |
| 1.1.3-preview.14 | 123 | 11/17/2023 |
| 1.1.3-preview.13 | 107 | 11/13/2023 |
| 1.1.3-preview.12 | 215 | 11/6/2023 |
| 1.1.3-preview.11 | 126 | 10/30/2023 |
| 1.1.3-preview.10 | 123 | 10/20/2023 |
| 1.1.3-preview.9 | 132 | 10/17/2023 |
| 1.1.3-preview.8 | 153 | 10/13/2023 |
| 1.1.3-preview.7 | 127 | 9/26/2023 |
| 1.1.3-preview.6 | 120 | 9/25/2023 |
| 1.1.3-preview.5 | 116 | 9/21/2023 |
| 1.1.3-preview.4 | 122 | 9/20/2023 |
| 1.1.3-preview.3 | 127 | 9/20/2023 |
| 1.1.3-preview.2 | 157 | 9/20/2023 |
| 1.1.3-preview.1 | 154 | 8/9/2023 |
| 1.1.2 | 150,746 | 7/20/2023 |
| 1.1.2-preview.20 | 184 | 7/20/2023 |