A lightweight, extensible library for orchestrating .NET application startup
Welcome to BeyondNet.Bootstrapper! A lightweight, extensible library for orchestrating the startup sequence of any .NET application or library. Based on the Composite pattern, it lets you encapsulate each initialization step as an independent, testable unit.
Built on .NET 10 with full support for async/await, Nullable Reference Types, and a Cloud Native observability stack.
# Core (always required)
dotnet add package BeyondNetCode.Shell.Bootstrapper
# Official adapters (add as needed)
dotnet add package BeyondNetCode.Shell.Bootstrapper.DependencyInjection
dotnet add package BeyondNetCode.Shell.Bootstrapper.AutoMapper
dotnet add package BeyondNetCode.Shell.Bootstrapper.Observability| Package | Description | NuGet |
|---|---|---|
BeyondNetCode.Shell.Bootstrapper |
Core bootstrapper with Composite pattern | link |
BeyondNetCode.Shell.Bootstrapper.DependencyInjection |
DI extension adapter | link |
BeyondNetCode.Shell.Bootstrapper.AutoMapper |
AutoMapper configuration adapter | link |
BeyondNetCode.Shell.Bootstrapper.Observability |
OpenTelemetry + Serilog adapter | link |
Without a standard, startup code tends to become a monolithic block in Program.cs that is hard to test and maintain. This library solves that by enforcing a single rule:
Each initialization concern lives in its own class. The Composite runs them in order.
Benefits:
- Each bootstrapper is independently unit-testable
- The startup sequence is explicit and readable
- Adding or removing a step never changes surrounding code
- Async I/O at startup cannot deadlock the application
public class MyBootstrapper : IBootstrapper
{
public void Run()
{
// Initialize your service
Console.WriteLine("Bootstrap complete!");
}
}
// Use
new CompositeBootstrapper()
.Add(new MyBootstrapper())
.Run();public class MyAsyncBootstrapper : IBootstrapperAsync
{
public async Task RunAsync()
{
await Task.Delay(100);
Console.WriteLine("Async bootstrap complete!");
}
}
// Use
await new CompositeBootstrapperAsync()
.Add(new MyAsyncBootstrapper())
.RunAsync();var composite = new CompositeBootstrapperAsync()
.Add(new DependencyInjectionBootstrapper(services =>
{
services.AddSingleton<IMyService, MyService>();
}))
.Add(new AutoMapperBootstrapper(cfg =>
{
cfg.CreateMap<Source, Dest>();
}))
.Add(new ObservabilityBootstrapper(services, config))
.Add(new MyCustomBootstrapper());
await composite.RunAsync();For detailed documentation, see the language-specific README files:
If you were using Ums.Shell.Bootstrapper, update your NuGet references:
# Before (Ums.Shell.Bootstrapper)
dotnet add package Ums.Shell.Bootstrapper
# After (BeyondNetCode.Shell.Bootstrapper)
dotnet add package BeyondNetCode.Shell.BootstrapperUpdate namespaces in your code:
// Before
using Ums.Shell.Bootstrapper;
// After
using BeyondNetCode.Shell.Bootstrapper;See CONTRIBUTING.md for GitFlow workflow, commit conventions, and coding standards.
See VERSIONING.md for SemVer strategy and release process.
Licensed under the Apache 2.0 License. See LICENSE for details.
See DISCLAIMER.md for original code authorship attribution.