Indiko.Hosting.Abstractions 2.1.2

dotnet add package Indiko.Hosting.Abstractions --version 2.1.2
                    
NuGet\Install-Package Indiko.Hosting.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.Hosting.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.Hosting.Abstractions" Version="2.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Indiko.Hosting.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.Hosting.Abstractions --version 2.1.2
                    
#r "nuget: Indiko.Hosting.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.Hosting.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.Hosting.Abstractions&version=2.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Indiko.Hosting.Abstractions&version=2.1.2
                    
Install as a Cake Tool

Indiko.Hosting.Abstractions

Core hosting abstractions providing a foundation for building .NET applications with standardized bootstrapping and startup patterns.

Overview

This package provides base classes, interfaces, and utilities for application hosting, configuration, logging setup, and lifecycle management. It integrates with the Indiko Blocks system for modular application composition.

Features

  • Base Host Bootstrapper: Abstract base class for host initialization with logging and configuration
  • Startup Abstractions: Interfaces for defining application startup configuration (IHostingStartup)
  • Configuration Utilities: Helper methods for configuration initialization
  • Logging Utilities: Standardized logger creation and setup
  • Block Integration: Seamless integration with Indiko Blocks management system
  • Request Metadata: Interface for accessing HTTP request metadata
  • Host Builder Extensions: Extensions for configuring host builders

Installation

dotnet add package Indiko.Hosting.Abstractions

Key Components

BaseHostBootstraper<T, TBaseStartup>

Base class for bootstrapping a host with automatic configuration and logging setup.

public class MyHostBootstrapper : BaseHostBootstraper<MyHostBootstrapper, IMyStartup>
{
    protected override IHostBuilder CreateHostBuilder<TStartup>(string[] args)
    {
        var builder = base.CreateHostBuilder<TStartup>(args);
        // Add custom configuration
        return builder;
    }
}

IHostingStartup

Interface marker for startup classes.

public interface IHostingStartup
{
    void ConfigureServices(IServiceCollection services);
    void Configure(IApplicationBuilder app, IServiceProvider services, IHostEnvironment environment);
}

Configuration and Logging Utilities

// Create configuration
var configuration = ConfigurationUtil.CreateConfiguration();

// Create logger
var logger = LogUtil.CreateLogger<MyClass>(configuration);

Usage Example

Creating a Custom Host

using Indiko.Hosting.Abstractions;
using Indiko.Hosting.Abstractions.Interfaces;

// Define your startup
public class MyStartup : IHostingStartup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddLogging();
        services.AddHttpClient();
        // Configure services
    }

    public void Configure(IApplicationBuilder app, IServiceProvider services, IHostEnvironment env)
    {
        // Configure middleware
    }
}

// Create bootstrapper
public class MyBootstrapper : BaseHostBootstraper<MyBootstrapper, IHostingStartup>
{
    // Optionally override methods for custom behavior
}

// Run application
class Program
{
    static async Task<int> Main(string[] args)
    {
        return await MyBootstrapper.Instance.RunAsync<MyStartup>(args);
    }
}

Integration with Blocks

The bootstrapper automatically integrates with the Indiko Blocks system:

// Blocks are automatically configured during host building
// 1. ConfigureBuilder is called for all registered blocks
// 2. ConfigureServices is called during service configuration
// 3. Configure is called during application configuration
// 4. PreRunAsync is called before the host runs

Architecture

Lifecycle

  1. Configuration Initialization: Load configuration from appsettings.json and environment
  2. Logger Creation: Create logger based on configuration
  3. Host Builder Creation: Create and configure IHostBuilder
  4. Block Configuration: Apply all registered blocks to the builder
  5. Host Building: Build the IHost instance
  6. Pre-Run Blocks: Execute pre-run logic for all blocks
  7. Host Run: Start the application

Block Integration Points

  • ConfigureBuilder(IHostBuilder): Configure the host builder
  • ConfigureServices(IServiceCollection): Register services
  • Configure(IApplicationBuilder, IServiceProvider, IHostEnvironment): Configure middleware
  • PreRunAsync(IServiceProvider): Execute logic before host runs

Target Framework

  • .NET 10

Dependencies

  • Indiko.Common.Runtime.Abstractions
  • Indiko.Blocks.Common.Abstractions
  • Indiko.Blocks.Common.Management
  • Microsoft.Extensions.Hosting
  • Microsoft.Extensions.Logging

License

See LICENSE file in the repository root.

  • Indiko.Hosting.Web - Web API hosting implementation
  • Indiko.Hosting.Mvc - MVC hosting implementation
  • Indiko.Hosting.BlazorServer - Blazor Server hosting implementation
  • Indiko.Hosting.Gateway - API Gateway hosting implementation
  • 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.Hosting.Abstractions:

Package Downloads
Indiko.Hosting.BlazorServer

Building Blocks Hosting Blazor Server

Indiko.Hosting.Web

Building Blocks Hosting Web

Indiko.Hosting.Gateway

Building Blocks Hosting Gateway

Indiko.Hosting.Mvc

Building Blocks Hosting MVC

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.2 354 12/18/2025
2.1.1 733 12/2/2025
2.1.0 709 12/2/2025
2.0.0 289 9/17/2025
1.7.23 396 9/8/2025
1.7.22 243 9/8/2025
1.7.21 245 8/14/2025
1.7.20 297 6/23/2025
1.7.19 230 6/3/2025
1.7.18 249 5/29/2025
1.7.17 242 5/26/2025
1.7.15 199 4/12/2025
1.7.14 211 4/11/2025
1.7.13 192 3/29/2025
1.7.12 208 3/28/2025
1.7.11 210 3/28/2025
1.7.10 207 3/28/2025
1.7.9 212 3/28/2025
1.7.8 207 3/28/2025
1.7.5 247 3/17/2025
Loading failed