Pragmatic.Configuration 1.0.0-alpha.5

This is a prerelease version of Pragmatic.Configuration.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Pragmatic.Configuration --version 1.0.0-alpha.5
                    
NuGet\Install-Package Pragmatic.Configuration -Version 1.0.0-alpha.5
                    
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="Pragmatic.Configuration" Version="1.0.0-alpha.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pragmatic.Configuration" Version="1.0.0-alpha.5" />
                    
Directory.Packages.props
<PackageReference Include="Pragmatic.Configuration" />
                    
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 Pragmatic.Configuration --version 1.0.0-alpha.5
                    
#r "nuget: Pragmatic.Configuration, 1.0.0-alpha.5"
                    
#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 Pragmatic.Configuration@1.0.0-alpha.5
                    
#: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=Pragmatic.Configuration&version=1.0.0-alpha.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Pragmatic.Configuration&version=1.0.0-alpha.5&prerelease
                    
Install as a Cake Tool

Pragmatic.Configuration

Zero-boilerplate configuration binding, validation, and DI registration via source generator, plus runtime stores with cascade resolution, multi-tenancy, hot-reload, and pluggable backends.

The Problem

Every IOptions<T> class needs the same binding/validation/registration boilerplate. Across 20 options classes that's hundreds of lines of ceremony, and validation is opt-in: forget one .ValidateDataAnnotations() and [Required] is silently ignored until it fails at runtime.

// 4 lines of ceremony per options class, repeated for every config type
services.AddOptions<BookingOptions>()
    .Bind(configuration.GetSection("Booking"))
    .ValidateDataAnnotations()
    .ValidateOnStart();

Beyond that: secrets vary by environment, dynamic reconfiguration needs a deploy, and per-tenant overrides become hardcoded switch statements.

The Solution: two pillars

Compile-time binding: annotate a class with [Configuration]; the generator produces the binding, DataAnnotation validation (on start, by default), and DI registration; the Pragmatic host calls that registration itself.

[Configuration]
public partial class BookingOptions
{
    [Required] public string CurrencyCode { get; init; } = "";
    [Range(1, 365)] public int MaxStayDays { get; init; }
}

Runtime stores (opt-in, AddPragmaticConfiguration()): a unified API over configuration with cascade resolution (user → tenant → environment → base, highest first; the tenant layer only with MultiTenant.Enabled), hot-reload, and pluggable backends (Database, Azure App Configuration, Redis, Consul, Kubernetes), without redeploying. Secrets live in an ISecretStore (Database, Azure Key Vault, AWS, GCP, Vault, Kubernetes), and a secret://{key} value is resolved from it at read time.

Installation

dotnet add package Pragmatic.Configuration
dotnet add package Pragmatic.SourceGenerator   # generates the [Configuration] binding

Status

Functional within 1.0.0-alpha: [Configuration] binding and validation, and the runtime stores (cascade, hot-reload, the backends above). See the roadmap.

Documentation

Guide What you'll learn
Concepts The two pillars, cascade resolution, hot-reload, choosing a backend
Getting Started Your first [Configuration] class and a runtime store
Stores Backends (Database, Azure), cascade, tenant overrides, hot-reload
Common Mistakes The most frequent configuration pitfalls
Troubleshooting Problem/solution guide with diagnostics

Requirements

  • .NET 10.0+
  • Pragmatic.SourceGenerator analyzer

Pragmatic.Configuration ships for net10.0 and net11.0, with the same API on both. On .NET 11 the generated binder allocates about 19% less per call.

License

Part of the Pragmatic.Design ecosystem. See Licensing. Pragmatic.Configuration is MIT-licensed.

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

NuGet packages (10)

Showing the top 5 NuGet packages that depend on Pragmatic.Configuration:

Package Downloads
Pragmatic.Configuration.Database

Database backend (ADO.NET) for Pragmatic.Configuration, supporting PostgreSQL, SQL Server, SQLite

Pragmatic.Configuration.Management

Admin management package for Pragmatic.Configuration. Provides DomainActions and endpoints for viewing, editing, and auditing configuration values.

Pragmatic.Agent.Client

Client library for connecting .NET apps to the Pragmatic Agent daemon. Provides AgentControlPlane, AgentConfigurationStore, AgentFeatureFlagStore, and socket-based IPC.

Pragmatic.Configuration.Gcp

Google Cloud backend for Pragmatic.Configuration: secrets via GCP Secret Manager.

Pragmatic.Configuration.Aws

AWS backend for Pragmatic.Configuration: secrets via AWS Secrets Manager and configuration via SSM Parameter Store.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.6 193 11/21/2026
1.0.0-alpha.5 123 11/21/2026
1.0.0-alpha.4 171 11/16/2026
1.0.0-alpha.3 536 10/17/2026
1.0.0-alpha.2 174 10/12/2026
1.0.0-alpha.1 398 10/3/2026