Eigenverft.NetLib.Configuration.Sets 1.0.0.5-g17613f8942

This is a prerelease version of Eigenverft.NetLib.Configuration.Sets.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Eigenverft.NetLib.Configuration.Sets --version 1.0.0.5-g17613f8942
                    
NuGet\Install-Package Eigenverft.NetLib.Configuration.Sets -Version 1.0.0.5-g17613f8942
                    
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="Eigenverft.NetLib.Configuration.Sets" Version="1.0.0.5-g17613f8942" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eigenverft.NetLib.Configuration.Sets" Version="1.0.0.5-g17613f8942" />
                    
Directory.Packages.props
<PackageReference Include="Eigenverft.NetLib.Configuration.Sets" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Eigenverft.NetLib.Configuration.Sets --version 1.0.0.5-g17613f8942
                    
#r "nuget: Eigenverft.NetLib.Configuration.Sets, 1.0.0.5-g17613f8942"
                    
#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.
#:package Eigenverft.NetLib.Configuration.Sets@1.0.0.5-g17613f8942
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Eigenverft.NetLib.Configuration.Sets&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Eigenverft.NetLib.Configuration.Sets&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Tool

Eigenverft.NetLib.Configuration.Sets

NuGet Version NuGet Downloads Repository CI Targets License

Coordinate related JSON configuration files as one application-defined profile choice. Each participant is prepared before the set changes, so a rejected candidate leaves the previous coordinated profile active.

✨ At a glance

Package Eigenverft.NetLib.Configuration.Sets
Main APIs AddConfigurationSet(...), IConfigurationSetManager
Source integration Eigenverft.NetLib.Configuration.SwitchableJson
Profile meanings Defined by the application
Target frameworks .NET 8 and .NET 10
License MIT

📦 Installation

dotnet add package Eigenverft.NetLib.Configuration.Sets

The package depends on Eigenverft.NetLib.Configuration.SwitchableJson; NuGet restores it automatically.

🚀 Quick start

Register a named set and bind one or more JSON files using the default {rootPath}/{value}/{fileName} layout. Create a directory and valid file for every value that should be selectable:

using System.IO;
using Eigenverft.NetLib.Configuration.Sets;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
string profilesRoot = Path.Combine(
    builder.Environment.ContentRootPath,
    "settings",
    "Operations");

builder.AddConfigurationSet(
        name: "OperationalProfile",
        initialValue: "Normal",
        additionalAllowedValues: ["Incident"])
    .AddSwitchableJson(
        rootPath: profilesRoot,
        fileNames: ["LoggerSettings.json", "Resilience.json"]);

using IHost host = builder.Build();
IConfigurationSetManager profiles =
    host.Services.GetRequiredService<IConfigurationSetManager>();

bool switched = profiles.TrySwitchRuntime(
    setName: "OperationalProfile",
    value: "Incident",
    result: out ConfigurationSetSwitchResult? result);

The manager is registered automatically with the first set. The synchronous call returns only after all participants have completed; inspect result when it returns false.

Set names, allowed values, paths, and policy meanings belong to the application. Runtime switches update ordinary IConfiguration values, so consumers must be reload-aware (for example, IOptionsMonitor<T>) to react to changes. Startup-only concerns such as the DI graph or middleware composition should wait for restart; use .ApplyMode(ConfigurationSetApplyMode.StartupOnly) when storing desired state. Sets coordinate Configuration.SwitchableJson sources; they do not define what a profile means. Value protection is an opt-in feature of those sources, using Configuration.Values codecs.

For custom file naming, register each participant with a sourcePathResolver. The ConfigurationSetRegistration returned by AddConfigurationSet is a startup handle; runtime switching normally goes through IConfigurationSetManager. The keyed IConfigurationSetCoordinator and IConfigurationSetEventHub provide set-level integration and observation.

AddConfigurationSetStateFile(path) adds an optional self-describing desired-state file, watcher, and DI state-store service for persisted operator or control-plane choices. Keep that state file separate from the profile files. For a single independently switched file without set coordination, use Eigenverft.NetLib.Configuration.SwitchableJson directly.

🎯 Target frameworks

The package targets net8.0 and net10.0.

📄 License

MIT License

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.5-gdfdd996480 0 9/29/2026
1.0.0.5-g17613f8942 0 9/29/2026
1.0.0.3-g28e841270d 0 9/28/2026
1.0.0.2-gbac57d8b97 0 9/11/2026
1.0.0.2-g9537b96514 0 9/11/2026

Initial capability package extracted from Eigenverft.NetLib.Infrastructure.