CasCap.Common.Configuration
4.16.0
Prefix Reserved
dotnet add package CasCap.Common.Configuration --version 4.16.0
NuGet\Install-Package CasCap.Common.Configuration -Version 4.16.0
<PackageReference Include="CasCap.Common.Configuration" Version="4.16.0" />
<PackageVersion Include="CasCap.Common.Configuration" Version="4.16.0" />
<PackageReference Include="CasCap.Common.Configuration" />
paket add CasCap.Common.Configuration --version 4.16.0
#r "nuget: CasCap.Common.Configuration, 4.16.0"
#:package CasCap.Common.Configuration@4.16.0
#addin nuget:?package=CasCap.Common.Configuration&version=4.16.0
#tool nuget:?package=CasCap.Common.Configuration&version=4.16.0
CasCap.Common.Configuration
Configuration bootstrapping helpers for .NET applications — standard IConfiguration pipeline setup, Azure Key Vault integration, and validated IOptions<T> binding for IAppConfig records.
Installation
dotnet add package CasCap.Common.Configuration
Target frameworks: netstandard2.0, net8.0, net9.0, net10.0
Usage
In a .NET 8+ host, register an
IAppConfig
record to bind and validate its named section:
using System.ComponentModel.DataAnnotations;
using CasCap.Common.Abstractions;
using CasCap.Common.Extensions;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddCasCapConfiguration<ExampleConfig>();
await builder.Build().RunAsync();
public sealed record ExampleConfig : IAppConfig
{
public static string ConfigurationSectionName => "Example";
[Required]
public string Greeting { get; init; } = "Hello";
}
Consumers inject IOptions<ExampleConfig> or IOptionsMonitor<ExampleConfig>.
The explicit-section overload, AddCasCapConfiguration<ExampleConfig>("Example"), also works on
.NET Standard 2.0.
On .NET 8+, GetCasCapConfiguration<TConfig>() eagerly binds and validates without registering DI
services. AddAndGetCasCapConfiguration<TConfig>(configuration) combines registration with that
eager read. A configuration delegate applies to registered options, not the separately bound
instance returned by the eager read.
Configuration Examples
Minimal Options
Add this section to the application's configuration:
{
"Example": {
"Greeting": "Hello"
}
}
Standard Configuration Sources
For applications constructing their own configuration pipeline:
using System.Reflection;
using CasCap.Common.Extensions;
using Microsoft.Extensions.Configuration;
var configuration = new ConfigurationBuilder()
.AddStandardConfiguration("Development", Assembly.GetExecutingAssembly())
.Build();
The base path is AppDomain.CurrentDomain.BaseDirectory. The base appsettings.json is required;
make sure it is copied to the output directory. Environment, local and test-local files are optional.
Pass no assembly to skip user secrets. Environment variables are added last by this helper;
it does not add command-line arguments.
Optional Key Vault Provider
Call AddKeyVaultConfiguration(vaultUri, credential) after adding the base sources. The caller
supplies an Azure TokenCredential. A null URI or credential leaves the provider unregistered.
AddKeyVaultConfigurationFrom obtains that tuple from a snapshot of the sources already added.
Use a prefix manager when one vault serves several configuration sections:
using CasCap.Common.Extensions;
var secretManager = new PrefixKeyVaultSecretManager(
sourcePrefix: "Example--Worker",
destinationPrefix: "Example",
exclusiveRootPrefix: "Example");
Pass the manager to either Key Vault helper. Example--Worker--Greeting maps to Example:Greeting.
Other Example--* prefixes are excluded, while names outside that reserved root retain the default
Key Vault mapping. Without exclusiveRootPrefix, only the selected source prefix is loaded.
Configuration Hierarchy
For a pipeline built with AddStandardConfiguration followed by a Key Vault helper, later
providers override earlier ones:
flowchart TD
START["ConfigurationBuilder"]
subgraph StandardConfig["AddStandardConfiguration()"]
BASE["SetBasePath(contentRoot)"]
APPSETTINGS["appsettings.json"]
ENV_FILE["appsettings.{Environment}.json"]
LOCAL["appsettings.Local.json"]
LOCAL_ENV["appsettings.Local.{Environment}.json"]
TEST_LOCAL["appsettings.Tests.Local.json"]
SECRETS["User Secrets<br/>(optional)"]
ENV_VARS["Environment Variables"]
end
subgraph KeyVaultConfig["AddKeyVaultConfiguration()"]
PARTIAL["Partial Build Config"]
EXTRACT["Extract Key Vault URI<br/>+ TokenCredential"]
KV["Azure Key Vault<br/>(secrets override)"]
end
subgraph Binding["IOptions Binding"]
VALIDATE["AddCasCapConfiguration<TConfig>()<br/>ValidateDataAnnotations<br/>ValidateOnStart"]
OPTIONS["IOptions<TConfig><br/>(DI injectable)"]
end
START --> BASE
BASE --> APPSETTINGS
APPSETTINGS --> ENV_FILE
ENV_FILE --> LOCAL
LOCAL --> LOCAL_ENV
LOCAL_ENV --> TEST_LOCAL
TEST_LOCAL --> SECRETS
SECRETS --> ENV_VARS
ENV_VARS --> PARTIAL
PARTIAL --> EXTRACT
EXTRACT -."if URI and credential present".-> KV
KV --> VALIDATE
ENV_VARS -."if no Key Vault".-> VALIDATE
VALIDATE --> OPTIONS
Layering Priority (later sources override earlier ones):
appsettings.jsonappsettings.{Environment}.jsonappsettings.Local.json(optional)appsettings.Local.{Environment}.json(optional)appsettings.Tests.Local.json(optional)- User Secrets (when an assembly is supplied)
- Environment Variables
- Azure Key Vault (if configured)
This is the helper's ordering, not a replacement for the defaults of every .NET host builder. Adding providers later can change precedence. Keep local overrides and credentials outside Git.
| 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 is compatible. 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. |
| .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
- Azure.Extensions.AspNetCore.Configuration.Secrets (>= 1.5.2)
- CasCap.Common.Abstractions (>= 4.16.0)
- CasCap.Common.Logging (>= 4.16.0)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.13)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Json (>= 10.0.13)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.13)
-
net10.0
- Azure.Extensions.AspNetCore.Configuration.Secrets (>= 1.5.2)
- CasCap.Common.Abstractions (>= 4.16.0)
- CasCap.Common.Logging (>= 4.16.0)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.13)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Json (>= 10.0.13)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.13)
-
net8.0
- Azure.Extensions.AspNetCore.Configuration.Secrets (>= 1.5.2)
- CasCap.Common.Abstractions (>= 4.16.0)
- CasCap.Common.Logging (>= 4.16.0)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.13)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Json (>= 10.0.13)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.13)
-
net9.0
- Azure.Extensions.AspNetCore.Configuration.Secrets (>= 1.5.2)
- CasCap.Common.Abstractions (>= 4.16.0)
- CasCap.Common.Logging (>= 4.16.0)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.13)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Json (>= 10.0.13)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.13)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on CasCap.Common.Configuration:
| Package | Downloads |
|---|---|
|
CasCap.Api.Azure.Auth
Helper library for Azure authentication. |
|
|
CasCap.Api.SignalCli
Typed .NET client for the signal-cli REST API with REST polling and JSON-RPC WebSocket transports, webhook endpoints, health checks, and INotifier integration. |
|
|
CasCap.Api.Knx
.NET client library for KNX building automation — connects via KNXnet/IP tunnelling or routing, monitors group-address telegrams, and fans events out to configurable sinks. |
|
|
CasCap.Api.DoorBird
.NET client library for DoorBird IP video door station — captures doorbell, motion and RFID events via the local LAN API and dispatches them to configurable sinks. |
|
|
CasCap.Api.Fronius
.NET client library for Fronius solar inverter monitoring — samples power-flow data via the local Solar API v1 and dispatches readings to configurable sinks. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.16.0 | 0 | 10/21/2026 |
| 4.15.0 | 131 | 10/6/2026 |
| 4.14.4 | 244 | 10/4/2026 |
| 4.14.3 | 145 | 9/28/2026 |
| 4.14.2 | 285 | 9/25/2026 |
| 4.14.1 | 354 | 9/23/2026 |
| 4.14.0 | 574 | 9/19/2026 |
| 4.13.0 | 116 | 9/15/2026 |
| 4.12.8 | 285 | 9/10/2026 |
| 4.12.7 | 144 | 9/4/2026 |
| 4.12.6 | 109 | 9/1/2026 |
| 4.12.5 | 128 | 8/20/2026 |
| 4.12.4 | 290 | 8/18/2026 |
| 4.12.3 | 310 | 7/15/2026 |
| 4.12.2 | 318 | 6/26/2026 |
| 4.12.1 | 310 | 6/14/2026 |
| 4.12.0 | 301 | 6/12/2026 |
| 4.11.9 | 310 | 6/10/2026 |
| 4.11.8 | 225 | 5/27/2026 |
| 4.11.7 | 129 | 5/27/2026 |