Extensions.Configuration
0.0.4
dotnet add package Extensions.Configuration --version 0.0.4
NuGet\Install-Package Extensions.Configuration -Version 0.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Extensions.Configuration" Version="0.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Extensions.Configuration --version 0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Extensions.Configuration, 0.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Extensions.Configuration as a Cake Addin #addin nuget:?package=Extensions.Configuration&version=0.0.4 // Install Extensions.Configuration as a Cake Tool #tool nuget:?package=Extensions.Configuration&version=0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Extensions.Configuration
Description
This is a umbrella package for two seperate packages
- Extensions.Configuration.Sources.Objects
- Extensions.Configuration.Resolver
Installation
dotnet add package Extensions.Configuration
Extensions.Configuration.Sources.Objects
Description
This package adds functionality to Microsoft.Extensions.Configuration, to use objects as configuration source.
Installation
dotnet add package Microsoft.Extensions.Configuration
dotnet add package Extensions.Configuration.Sources.Objects
Usage
using Microsoft.Extensions.Configuration;
var configuration = new ConfigurationBuilder
.AddObject(new { K1 = "V1" })
.Build();
var val = configuration["K1"];
// Returns "V1"
Nesting is supported
var configuration = new ConfigurationBuilder
.AddObject(new { K1 = new { K2 = "V1" } } })
.Build();
var val = configuration["K1:K2"];
// Returns "V1"
Extensions.Configuration.Resolver
Description
This package adds functionality to Microsoft.Extensions.Configuration, to resolve substitutions within configuration entries.
Installation
dotnet add package Microsoft.Extensions.Configuration
dotnet add package Extensions.Configuration.Resolver
Usage
Examplary json configuration:
{
"AppName": "MyApp",
"UserSettings": "${HOMEPATH}/.{$env:AppName}/settings.json"
}
using Microsoft.Extensions.Configuration;
var configuration = new ConfigurationBuilder
.AddJsonFile(...)
.AddEnvironmentVariables()
.Build();
var userSettingsResolved = configuration.ResolveValue("UserSettings");
// Returns e.g.: "C:\Users\MyUser\.MyApp\settings.json"
Remarks
Supported placeholders:
{$env:KEY}, ${KEY}, $(KEY), %KEY%
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Extensions.Configuration.Resolver (>= 0.0.4)
- Extensions.Configuration.Sources.Objects (>= 0.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.