VOOZH about

URL: https://www.nuget.org/packages/Codebelt.Bootstrapper.Worker/

⇱ NuGet Gallery | Codebelt.Bootstrapper.Worker 5.1.1




👁 Image
Codebelt.Bootstrapper.Worker 5.1.1

dotnet add package Codebelt.Bootstrapper.Worker --version 5.1.1
 
 
NuGet\Install-Package Codebelt.Bootstrapper.Worker -Version 5.1.1
 
 
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="Codebelt.Bootstrapper.Worker" Version="5.1.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Codebelt.Bootstrapper.Worker" Version="5.1.1" />
 
Directory.Packages.props
<PackageReference Include="Codebelt.Bootstrapper.Worker" />
 
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 Codebelt.Bootstrapper.Worker --version 5.1.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Codebelt.Bootstrapper.Worker, 5.1.1"
 
 
#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 Codebelt.Bootstrapper.Worker@5.1.1
 
 
#: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=Codebelt.Bootstrapper.Worker&version=5.1.1
 
Install as a Cake Addin
#tool nuget:?package=Codebelt.Bootstrapper.Worker&version=5.1.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

About

An open-source family of assemblies (MIT license) that provide a uniform and consistent way of bootstraping your code with Program.cs paired with Startup.cs.

Also, common for all, is the implementation of the IHostedService interface; this means that all project types, including the traditional console, now have option for graceful shutdown should your application require this (cronjob scenarios or similar).

Your versatile Bootstrapper companion for modern development with .NET 9 and .NET 10.

It is, by heart, free, flexible and built to extend and boost your agile codebelt.

Codebelt.Bootstrapper.Worker

An implementation optimized for worker services.

Related Packages

CSharp Example

An example on how to use Codebelt.Bootstrapper.Worker in C#:


// --- Program.cs ---

public class Program : WorkerProgram<Startup>
{
 static async Task Main(string[] args)
 {
 await CreateHostBuilder(args)
 .Build()
 .RunAsync()
 .ConfigureAwait(false);
 }
}

// --- Startup.cs ---

public class Startup : WorkerStartup
{
 public Startup(IConfiguration configuration, IHostEnvironment environment) : base(configuration, environment)
 {
 }

 public override void ConfigureServices(IServiceCollection services)
 {
 services.AddHostedService<FakeHostedService>();
 }
}

// --- FakeHostedService.cs ---

public class FakeHostedService : BackgroundService
{
 private readonly ILogger<FakeHostedService> _logger;
 private bool _gracefulShutdown;

 public FakeHostedService(ILogger<FakeHostedService> logger)
 {
 _logger = logger;

 BootstrapperLifetime.OnApplicationStartedCallback = () => logger.LogInformation("Started");
 BootstrapperLifetime.OnApplicationStoppingCallback = () =>
 {
 _gracefulShutdown = true;
 logger.LogWarning("Stopping and cleaning ..");
 Thread.Sleep(TimeSpan.FromSeconds(5)); // simulate graceful shutdown
 logger.LogWarning(".. done!");
 };
 BootstrapperLifetime.OnApplicationStoppedCallback = () => logger.LogCritical("Stopped");
 }

 protected override async Task ExecuteAsync(CancellationToken stoppingToken)
 {
 while (!stoppingToken.IsCancellationRequested)
 {
 if (_gracefulShutdown) { return; }
 _logger.LogInformation("Worker running at: {time}", DateTimeOffset.UtcNow.ToString("O"));
 await Task.Delay(TimeSpan.FromSeconds(2), stoppingToken);
 }
 }
}

And the minimal equivalent example on how to use Codebelt.Bootstrapper.Worker in C#:


// --- Program.cs ---

public class Program : MinimalWorkerProgram
{
 static Task Main(string[] args)
 {
 var builder = CreateHostBuilder(args);
 builder.Services.AddHostedService<FakeHostedService>();

 var host = builder.Build();
 return host.RunAsync();
 }
}

Product Versions Compatible and additional computed target framework versions.
.NET net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.1.1 98 6/7/2026
5.1.0 236 5/27/2026
5.0.7 109 4/18/2026
5.0.6 118 3/29/2026
5.0.5 190 3/1/2026
5.0.4 115 2/21/2026
5.0.3 115 2/15/2026
5.0.2 315 12/17/2025
5.0.1 249 12/7/2025
5.0.0 242 11/14/2025
4.0.5 370 9/15/2025
4.0.4 224 8/20/2025
4.0.3 221 7/11/2025
4.0.2 267 6/16/2025
4.0.1 264 5/25/2025
4.0.0 229 4/12/2025
3.0.1 210 1/31/2025
3.0.0 193 11/13/2024
3.0.0-rc.1 126 11/11/2024
3.0.0-preview.2 131 10/13/2024
Loading failed

Version: 5.1.1
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.7
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.6
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.5
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.4
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.3
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.2
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.1
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 5.0.0
Availability: .NET 10 and .NET 9

# ALM
- ADDED Support for TFM .NET 10 (LTS)
- REMOVED Support for TFM .NET 8 (LTS)
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 4.0.6
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 4.0.5
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 4.0.4
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 4.0.3
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 4.0.2
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 4.0.1
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 4.0.0
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies to latest and greatest with respect to TFMs

Version: 3.0.1
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies to latest and greatest with respect to TFMs

Version: 3.0.0
Availability: .NET 9 and .NET 8

# ALM
- CHANGED Dependencies to latest and greatest with respect to TFMs
- REMOVED Support for TFM .NET 6 (LTS)

# New Features
- ADDED MinimalWorkerProgram class in the Codebelt.Bootstrapper.Worker namespace that is the entry point of an application optimized for worker applications

Version: 2.0.0
Availability: .NET 6.0 and .NET 8.0

# ALM
- REMOVED TFM for net7.0
- CHANGED Dependencies to latest and greatest with respect to TFMs

Version: 1.3.0
Availability: .NET 6.0, .NET 7.0, .NET 8.0

# ALM
- CHANGED Dependencies to latest and greatest

Version: 1.2.0
Availability: .NET 6.0, .NET 7.0, .NET 8.0

# ALM
- ADDED TFM for net8.0
- CHANGED Dependencies to latest and greatest with respect to TFMs

Version: 1.1.0
Availability: .NET 6.0, .NET 7.0

# ALM
- ADDED TFM for .NET 7
- CHANGED Dependencies to latest and greatest with respect to TFM

Version: 1.0.1
Availability: .NET 5.0, .NET 6.0

# ALM
- ADDED TFM for .NET 6
- CHANGED Dependencies to latest and greatest with respect to TFM

Version: 1.0.0
Availability: .NET 5.0

# New Features
- ADDED HostBuilderExtensions class in the Codebelt.Bootstrapper.Worker namespace that consist of extension methods for the IHostBuilder interface: UseWorkerStartup
- ADDED WorkerProgram class in the Codebelt.Bootstrapper.Worker namespace that is the base entry point of an application responsible for registering its WorkerStartup partner
- ADDED WorkerStartup interface in the Codebelt.Bootstrapper.Worker namespace that provides the base class of a conventional based Startup class for a console application