Indiko.Blocks.Configuration.Abstractions 2.1.2

dotnet add package Indiko.Blocks.Configuration.Abstractions --version 2.1.2
                    
NuGet\Install-Package Indiko.Blocks.Configuration.Abstractions -Version 2.1.2
                    
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="Indiko.Blocks.Configuration.Abstractions" Version="2.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Indiko.Blocks.Configuration.Abstractions" Version="2.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Indiko.Blocks.Configuration.Abstractions" />
                    
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 Indiko.Blocks.Configuration.Abstractions --version 2.1.2
                    
#r "nuget: Indiko.Blocks.Configuration.Abstractions, 2.1.2"
                    
#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 Indiko.Blocks.Configuration.Abstractions@2.1.2
                    
#: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=Indiko.Blocks.Configuration.Abstractions&version=2.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Indiko.Blocks.Configuration.Abstractions&version=2.1.2
                    
Install as a Cake Tool

Indiko.Blocks.Configuration.Abstractions

Core abstractions for configuration management in the Indiko framework, providing interfaces and factories for building custom configuration sources.

Overview

This package defines the core contracts and base types for implementing configuration blocks. It provides the foundation for loading configuration from various sources like files, environment variables, or external configuration stores.

Features

  • IConfigurationBlock: Marker interface for configuration block implementations
  • IBlockConfigurationBuilder: Interface for building configuration blocks
  • ConfigurationBuilderFactory: Factory for creating configuration builders
  • Constants: Common configuration-related constants
  • Extensibility: Foundation for custom configuration sources

Installation

dotnet add package Indiko.Blocks.Configuration.Abstractions

Key Components

IConfigurationBlock

Marker interface identifying configuration blocks in the Indiko Blocks system.

public interface IConfigurationBlock : IBlock
{
    // Marker interface for configuration blocks
}

IBlockConfigurationBuilder

Interface for building configuration blocks.

public interface IBlockConfigurationBuilder
{
    IConfigurationBlock Build();
}

ConfigurationBuilderFactory

Factory class for creating configuration builder instances.

var factory = new ConfigurationBuilderFactory();
var builder = factory.CreateBuilder<MyConfigurationBuilder>();
var block = builder.Build();

Usage Example

Implementing a Custom Configuration Block

using Indiko.Blocks.Configuration.Abstractions.Interfaces;
using Indiko.Blocks.Common.Abstractions;

// Define the interface
public interface IMyConfigurationBlock : IConfigurationBlock
{
}

// Implement the builder
public class MyConfigurationBuilder : IBlockConfigurationBuilder
{
    public IConfigurationBlock Build()
    {
        return new MyConfigurationBlock();
    }
}

// Implement the block
public class MyConfigurationBlock : BlockBase, IMyConfigurationBlock
{
    public MyConfigurationBlock(IConfiguration configuration, ILogger logger) 
        : base(configuration, logger)
    {
    }

    public override void ConfigureServices(IServiceCollection services)
    {
        // Load configuration from your source
        services.Configure<MySettings>(configuration.GetSection("MySettings"));
        
        base.ConfigureServices(services);
    }
}

Using the Factory

var factory = new ConfigurationBuilderFactory();
var builder = factory.CreateBuilder<MyConfigurationBuilder>();
var configBlock = builder.Build();

Architecture

Configuration blocks in the Indiko framework:

  1. Load Early: Configuration blocks typically have BlockLoadOrder(-1) to load before other blocks
  2. Extend IConfiguration: Add configuration sources to the ASP.NET Core configuration system
  3. Type-Safe Settings: Bind configuration to strongly-typed settings classes
  4. Hot Reload: Support configuration changes without restarting the application

Integration with Blocks System

Configuration blocks integrate seamlessly with the Indiko Blocks management system:

// Configuration blocks are automatically discovered and loaded
BlockManager.ConfigureBlock<IConfigurationBlock>(
    block => block.ConfigureServices(services), 
    configuration, 
    logger
);

Block Load Order

Configuration blocks typically load before other blocks:

[BlockLoadOrder(-1)]  // Load early in the lifecycle
public class MyConfigurationBlock : BlockBase, IConfigurationBlock
{
    // Implementation
}

Best Practices

  1. Load Order: Use BlockLoadOrder(-1) to ensure configuration loads early
  2. Validation: Validate configuration settings during startup
  3. Defaults: Provide sensible default values
  4. Documentation: Document required configuration sections
  5. Error Handling: Provide clear error messages for missing or invalid configuration

Target Framework

  • .NET 10

Dependencies

  • Indiko.Blocks.Common.Abstractions
  • Microsoft.Extensions.Configuration.Abstractions

License

See LICENSE file in the repository root.

  • Indiko.Blocks.Configuration.AppSettings - Load configuration from appsettings.json
  • Indiko.Blocks.Configuration.Consul - Load configuration from HashiCorp Consul
  • Indiko.Blocks.Common.Management - Block management system
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. 
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 Indiko.Blocks.Configuration.Abstractions:

Package Downloads
Indiko.Common.Runtime.Abstractions

Building Blocks Runtime Abstractions

Indiko.Hosting.Abstractions

Building Blocks Hosting Abstractions

Indiko.Blocks.Configuration.Consul

Building Blocks Configuration Provider for Consul Key Value Store

Indiko.Blocks.Configuration.AppSettings

Building Blocks Configuration App Settings

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.2 228 12/18/2025
2.1.1 735 12/2/2025
2.1.0 712 12/2/2025
2.0.0 270 9/17/2025
1.7.23 414 9/8/2025
1.7.22 264 9/8/2025
1.7.21 264 8/14/2025
1.7.20 302 6/23/2025
1.7.19 236 6/3/2025
1.7.18 266 5/29/2025
1.7.17 270 5/26/2025
1.7.15 223 4/12/2025
1.7.14 223 4/11/2025
1.7.13 218 3/29/2025
1.7.12 213 3/28/2025
1.7.11 234 3/28/2025
1.7.10 232 3/28/2025
1.7.9 230 3/28/2025
1.7.8 222 3/28/2025
1.7.5 267 3/17/2025
1.7.4 240 3/16/2025
1.7.3 229 3/16/2025
1.7.2 243 3/16/2025
1.7.1 287 3/11/2025
1.7.0 225 3/11/2025
1.6.8 254 3/11/2025
1.6.7 328 3/4/2025
1.6.6 225 2/26/2025
1.6.5 223 2/20/2025
1.6.4 214 2/20/2025
1.6.3 221 2/5/2025
1.6.2 209 1/24/2025
1.6.1 212 1/24/2025
1.6.0 179 1/16/2025
1.5.2 251 1/16/2025
1.5.1 269 11/3/2024
1.5.0 234 10/26/2024
1.3.2 255 10/24/2024
1.3.0 263 10/10/2024
1.2.5 252 10/9/2024
1.2.4 278 10/8/2024
1.2.1 239 10/3/2024
1.2.0 256 9/29/2024
1.1.1 243 9/23/2024
1.1.0 258 9/18/2024
1.0.33 280 9/15/2024
1.0.28 283 8/28/2024
1.0.27 276 8/24/2024
1.0.26 249 7/7/2024
1.0.25 250 7/6/2024
1.0.24 264 6/25/2024
1.0.23 266 6/1/2024
1.0.22 281 5/14/2024
1.0.21 255 5/14/2024
1.0.20 273 4/8/2024
1.0.19 254 4/3/2024
1.0.18 271 3/23/2024
1.0.17 270 3/19/2024
1.0.16 292 3/19/2024
1.0.15 270 3/11/2024
1.0.14 286 3/10/2024
1.0.13 267 3/6/2024
1.0.12 293 3/1/2024
1.0.11 266 3/1/2024
1.0.10 275 3/1/2024
1.0.9 304 3/1/2024
1.0.8 295 2/19/2024
1.0.7 281 2/17/2024
1.0.6 268 2/17/2024
1.0.5 287 2/17/2024
1.0.4 285 2/7/2024
1.0.3 294 2/6/2024
1.0.1 239 2/6/2024
1.0.0 341 1/9/2024
1.0.0-preview99 267 12/22/2023
1.0.0-preview98 251 12/21/2023
1.0.0-preview97 258 12/21/2023
1.0.0-preview96 253 12/20/2023
1.0.0-preview95 211 12/20/2023
1.0.0-preview94 255 12/18/2023
1.0.0-preview101 266 1/5/2024