Bonfire.Hosting.ServiceProcess 2023.4.8.3

dotnet add package Bonfire.Hosting.ServiceProcess --version 2023.4.8.3                
NuGet\Install-Package Bonfire.Hosting.ServiceProcess -Version 2023.4.8.3                
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="Bonfire.Hosting.ServiceProcess" Version="2023.4.8.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bonfire.Hosting.ServiceProcess --version 2023.4.8.3                
#r "nuget: Bonfire.Hosting.ServiceProcess, 2023.4.8.3"                
#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.
// Install Bonfire.Hosting.ServiceProcess as a Cake Addin
#addin nuget:?package=Bonfire.Hosting.ServiceProcess&version=2023.4.8.3

// Install Bonfire.Hosting.ServiceProcess as a Cake Tool
#tool nuget:?package=Bonfire.Hosting.ServiceProcess&version=2023.4.8.3                

❤️‍🔥 Bonfire.Net

Bonfire.Net is a collection of libraries that make it easy to add hosting and dependency injection to your .NET Framework applications. Say goodbye to boilerplate and hello to a cleaner, more testable codebase.

License

💁‍♀️ Getting Started

Get started by reviewing the answers to the following questions:

✅ Small changes, continuously integrated

Bonfire.Net employs workflows for continuous integration to ensure the repository is held to industry standards; here's the current state of those workflows:

.NET Workflow

💎 A few more gems

We believe in keeping the community informed, so here's a few more tidbits of information to satisfy some additional curiosities:

Contributors Issues Stars Size Line Count

🔥 Working with Bonfire.Net

The primary objective of Bonfire.Net is to make it easy to add hosting and dependency injection to your .NET Framework applications. To do this, we offer a static class called Ignite that provides a simple way to bootstrap your application.

⚙️ Configuring the host

The Ignite class provides a number of methods that can be used to configure the host. For example, you can configure the host to use a specific startup class:

public static void Main(string[] args) =>
    Ignite.UseStartup<Startup>(args)
          .Run();

You can also configure the host manually by providing an Action<IHostBuilder>:

public static void Main(string[] args) =>
    Ignite.Configure(builder =>
    {
        builder.UseContentRoot(Directory.GetCurrentDirectory());
        builder.UseEnvironment(EnvironmentName.Development);
        builder.UseStartup<Startup>();
    }, args)
    .Run();

▶️ Creating a Startup class

Get started by creating a Startup class with a ConfigureServices method:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Add services here
    }
}
🏗️ Using Ignition for configuration

For those who like compile-time enforcement, the Ignition class provides an alternative to the reflective approach used by the Startup class that ensures method names don't have typos. To use it, derive your Startup class from Ignition and override the methods you need:

internal sealed class Startup : Ignition
{
    protected override void Configure(IHostBuilder builder)
    {
        // Add configuration here
    }
    protected override void ConfigureServices(IServiceCollection services)
    {
        // Add services here
    }
}

Then, update your Program class to use Ignite and the UseIgnition method which constrains the type argument to ensure it derives from Ignition:

public static void Main(string[] args) =>
    Ignite.UseIgnition<Startup>(args)
          .Run();

There is no inherit behavior in the Ignition class, so you'll need to provide your own implementation for each method you override.

🖥️ Hosting a Windows service

To run your application as a Windows Service, you'll need to add a reference to the Bonfire.Hosting.ServiceProcess package. Then derive from WindowsService instead of ServiceBase:

public class MyService : WindowsService
{
    // The rest of your service stays the same.
}

Then, update your Program class to use Ignite:

public static void Main(string[] args) =>
    Ignite.UseStartup<Startup>(args)
          .Run<MyService>();
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 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
2023.4.8.3 204 4/8/2023

Initial release.