Tago.Extensions.Configuration
6.0.0
dotnet add package Tago.Extensions.Configuration --version 6.0.0
NuGet\Install-Package Tago.Extensions.Configuration -Version 6.0.0
<PackageReference Include="Tago.Extensions.Configuration" Version="6.0.0" />
paket add Tago.Extensions.Configuration --version 6.0.0
#r "nuget: Tago.Extensions.Configuration, 6.0.0"
// Install Tago.Extensions.Configuration as a Cake Addin #addin nuget:?package=Tago.Extensions.Configuration&version=6.0.0 // Install Tago.Extensions.Configuration as a Cake Tool #tool nuget:?package=Tago.Extensions.Configuration&version=6.0.0
Tago.Extensions.Configuration
Tago.Extensions.Configuration is a powerful .NET Core configuration library that enhances the flexibility of your appsettings.json
by allowing dynamic property resolution. With this library, you can reference environment variables and other configuration properties directly within your configuration file, making your application configuration more dynamic and maintainable.
Features
- Environment Variable Resolution: Easily reference environment variables within your
appsettings.json
. - Property Chaining: Reference other configuration properties within the same file, enabling complex configurations.
- Seamless Integration: Integrates effortlessly with the standard .NET Core configuration system.
Installation
You can install the package via NuGet Package Manager:
dotnet add package Tago.Extensions.Configuration
Or by using the NuGet Package Manager Console:
Install-Package Tago.Extensions.Configuration
Usage
Basic Setup
To use Tago.Extensions.Configuration, you need to add it to your configuration builder in Program.cs
or Startup.cs
:
var builder = WebApplication.CreateBuilder(args);
// Add dynamic configuration
builder.Configuration.AddDynamicConfiguration();
var app = builder.Build();
Configuration Example
Here is an example of how you can use dynamic properties in your appsettings.json
:
{
"AppSettings": {
"Test": "Test",
"Test2": "{env: TEST}",
"Test3": "{property: AppSettings:TEST}",
"Test4": "{property: AppSettings:Test3}",
"Test5": "{property: AppSettings:Test4} {property: AppSettings:Test2}"
}
}
Explanation
- Test: A static value.
- Test2: Resolves to the value of the
TEST
environment variable. - Test3: Resolves to the value of the
Test
property within theAppSettings
section. - Test4: Resolves to the value of the
Test3
property within theAppSettings
section. - Test5: Combines the values of
Test4
andTest2
properties within theAppSettings
section.
Accessing Configuration in Code
You can access these configuration values in your application code as usual:
var testValue = builder.Configuration["AppSettings:Test"];
var test2Value = builder.Configuration["AppSettings:Test2"];
var test5Value = builder.Configuration["AppSettings:Test5"];
Handling Missing Properties
By default, if a property or environment variable is not found, the library will throw an exception. You can customize this behavior by providing a fallback value or handling it gracefully in your application.
{
"AppSettings": {
"Test6": "{env: NON_EXISTENT_ENV || default_value}"
}
}
Support
If you encounter any issues or have questions, please email support@tago-solutions.com.
Thank you for using Tago.Extensions.Configuration! We hope it makes your .NET Core configuration management easier and more dynamic.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 was computed. 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. |
.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.AspNetCore.Hosting (>= 2.2.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.0.0)
- Microsoft.Extensions.Configuration.Json (>= 3.0.0)
- Newtonsoft.Json (>= 13.0.1)
- System.Text.Json (>= 4.7.0)
- Tago.Extensions.Encryption (>= 3.1.1-preview-20200917-01)
-
net6.0
- Microsoft.AspNetCore.Hosting (>= 2.2.7)
- Microsoft.Extensions.Configuration (>= 6.0.2)
- Microsoft.Extensions.Configuration.Json (>= 6.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.4)
- Newtonsoft.Json (>= 13.0.1)
- Tago.Extensions.Encryption (>= 3.1.1-preview-20200917-01)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Tago.Extensions.Configuration:
Package | Downloads |
---|---|
Tago.Extensions.Configuration.ExternalJson
Configuration provider from External json |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
6.0.0 | 49 | 2/20/2025 |
3.1.1-preview-20201202-01 | 516 | 12/2/2020 |
3.1.1-preview-20200917-01 | 301 | 9/17/2020 |
3.1.0-preview-01 | 268 | 8/20/2020 |