Indiko.Common.Runtime.Abstractions 2.1.2

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

Indiko.Common.Runtime.Abstractions

Runtime abstractions for application bootstrapping and startup configuration in the Indiko framework.

Overview

This package provides base classes and interfaces for implementing custom bootstrappers and startup classes, enabling standardized application initialization patterns.

Features

  • Base Bootstrapper: Abstract base class for application bootstrapping with lifecycle management
  • Singleton Pattern: Built-in lazy singleton implementation for bootstrapper instances
  • Startup Abstractions: Interfaces for defining application startup configuration
  • Type-Safe Constraints: Generic constraints ensuring proper startup class implementations
  • Async Support: Asynchronous application initialization and execution

Installation

dotnet add package Indiko.Common.Runtime.Abstractions

Key Components

IBaseStartup

Base interface for startup classes that configure application services and middleware.

public interface IBaseStartup
{
    // Marker interface for startup classes
}

IServiceBootstrapper<TStartupConstraint>

Interface for bootstrappers that initialize applications with specific startup types.

BaseBootstrapper<TBootstrapper, TStartupConstraint>

Abstract base class providing bootstrapping functionality with singleton pattern and lifecycle management.

Usage Example

Creating a Custom Bootstrapper

using Indiko.Common.Runtime.Abstractions;
using Indiko.Common.Runtime.Abstractions.Interfaces;

// Define your startup interface
public interface IWebStartup : IBaseStartup
{
    void ConfigureServices(IServiceCollection services);
    void Configure(IApplicationBuilder app);
}

// Implement the bootstrapper
public class WebBootstrapper : BaseBootstrapper<WebBootstrapper, IWebStartup>
{
    public override async Task<int> RunAsync<TStartup>(string[] args)
        where TStartup : class, IWebStartup
    {
        try
        {
            var builder = WebApplication.CreateBuilder(args);
            
            var startup = Activator.CreateInstance<TStartup>();
            startup.ConfigureServices(builder.Services);
            
            var app = builder.Build();
            startup.Configure(app);
            
            await app.RunAsync();
            return 0;
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Application failed: {ex.Message}");
            return 1;
        }
    }
}

// Implement the startup class
public class Startup : IWebStartup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddControllers();
        // ... configure services
    }
    
    public void Configure(IApplicationBuilder app)
    {
        app.UseRouting();
        app.UseEndpoints(endpoints => endpoints.MapControllers());
        // ... configure middleware
    }
}

// Use the bootstrapper
class Program
{
    static async Task<int> Main(string[] args)
    {
        return await WebBootstrapper.Instance.RunAsync<Startup>(args);
    }
}

Benefits

  1. Separation of Concerns: Clean separation between bootstrapping logic and application configuration
  2. Reusability: Bootstrapper can be reused across multiple applications with different startup classes
  3. Type Safety: Generic constraints ensure startup classes implement required interfaces
  4. Singleton Pattern: Built-in singleton ensures only one bootstrapper instance per application
  5. Error Handling: Robust error handling during instance creation and initialization

Architecture

The bootstrapper pattern follows these principles:

  1. Lazy Initialization: Bootstrapper instances are created only when first accessed
  2. Generic Constraints: Type safety through generic parameters and constraints
  3. Async First: Async/await support throughout the lifecycle
  4. Extensibility: Abstract methods allow custom initialization logic

Target Framework

  • .NET 10

Dependencies

None - this is a zero-dependency abstraction package.

License

See LICENSE file in the repository root.

  • Indiko.Common.Abstractions - Core abstractions and base types
  • Indiko.Hosting.Abstractions - Hosting-specific abstractions
  • Indiko.Hosting.Web - Web application hosting implementation
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 (1)

Showing the top 1 NuGet packages that depend on Indiko.Common.Runtime.Abstractions:

Package Downloads
Indiko.Hosting.Abstractions

Building Blocks Hosting Abstractions

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.2 338 12/18/2025
2.1.1 745 12/2/2025
2.1.0 727 12/2/2025
2.0.0 306 9/17/2025
1.7.23 409 9/8/2025
1.7.22 245 9/8/2025
1.7.21 248 8/14/2025
1.7.20 281 6/23/2025
1.7.19 265 6/3/2025
1.7.18 241 5/29/2025
1.7.17 248 5/26/2025
1.7.15 199 4/12/2025
1.7.14 211 4/11/2025
1.7.13 210 3/29/2025
1.7.12 222 3/28/2025
1.7.11 216 3/28/2025
1.7.10 238 3/28/2025
1.7.9 230 3/28/2025
1.7.8 211 3/28/2025
1.7.5 257 3/17/2025
Loading failed