Albatross.Config 8.0.0-43.main

Prefix Reserved
This is a prerelease version of Albatross.Config.
This package has a SemVer 2.0.0 package version: 8.0.0-43.main+8c7073c.
dotnet add package Albatross.Config --version 8.0.0-43.main
                    
NuGet\Install-Package Albatross.Config -Version 8.0.0-43.main
                    
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="Albatross.Config" Version="8.0.0-43.main" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Albatross.Config" Version="8.0.0-43.main" />
                    
Directory.Packages.props
<PackageReference Include="Albatross.Config" />
                    
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 Albatross.Config --version 8.0.0-43.main
                    
#r "nuget: Albatross.Config, 8.0.0-43.main"
                    
#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 Albatross.Config@8.0.0-43.main
                    
#: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=Albatross.Config&version=8.0.0-43.main&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Albatross.Config&version=8.0.0-43.main&prerelease
                    
Install as a Cake Tool

Albatross.Config

Simplified configuration setup for your .Net applications.

Features

  • Use Strong typed configuration class without using the IOptions<> interface.
  • Built-In ProgramSetting and EnvironmentSetting config class.
  • Built-In endpoints configuration key similar to the connectionStrings key provided by default.
  • Validate configuration data using data annotation attributes in the System.DataAnnotation namespace or implement your own validation.
  • Custom implementation of IHostEnvironment to save us from changing prod data by accident. See HELP! My developers are also DBAs.

Source Code

Documentation

Quick Start

Albatross.Config allows users to create strong typed config classes to manage the configuration data. The config class requires a base class of Albatross.Config.ConfigBase and a constructor with a single parameter of type Microsoft.Extensions.Configuration.IConfiguration.

Here is an example of appsettings.json file and the matching config class.

{
	"connectionStrings" : {
		"azure-db" : "..."
	},
	"endpoints": {
		"ms-graph" : "..."
	},
	"my-config" : {
		"configData" : "..."
	}
}
public class MyConfig : ConfigBase {
	public MyConfig(IConfiguration configuration) : base(configuration, "my-config") {
		this.MsGraphicEndPoint = configuration.GetRequiredEndPoint("ms-graph");
		this.MyConnectionString = configuration.GetRequiredConnectionString("azure-db");
	}
	[Required]
	public string ConfigData { get; }
	public string MsGraphicEndPoint { get; }
	public string MyConnectionString { get; }
	public override void Validate() {
		base.Validate();
	}
}

If the Key of the config class is defined, the json values of the key in the appsettings.json file will be binded to the config class. The Validate method of the class will be invoked after the creation of its instance. An exception will be thrown if there are any validation errors.

Once the config class is registered using DI, it can be injected directly to classes as a dependency. The AddConfig method by default registers the config class as a Singleton. AddConfig(false) will register the class with a scoped lifetime. The scoped lifetime is useful in the rare case of config data change.

	public static IServiceCollection RegisterMyServices(this IServiceCollection services) {
		services.AddConfig<MyConfig>();
		return services;
	}
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 was computed.  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.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Albatross.Config:

Package Downloads
Albatross.Hosting

A library for creating .Net Web Api or Service applications with preconfigured settings

Albatross.Caching

This assembly contains cache management logic using Polly

Albatross.Messaging

A durable messaging library built on top of ZeroMQ

Albatross.CommandLine.Defaults

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0-43.main 26 5/30/2026
8.0.0-36.main 27 5/27/2026
7.5.11 537 12/10/2025
7.5.10 89 11/26/2025
7.5.9 285 2/27/2025
7.5.8 189 11/19/2024
7.5.7 157 11/11/2024
7.5.6 132 11/8/2024
7.5.5 118 11/7/2024
7.5.4 111 11/7/2024
7.4.2 149 10/8/2024
7.4.1 150 10/5/2024
Loading failed