Codebelt.Bootstrapper.Web 3.0.0-preview.2

This is a prerelease version of Codebelt.Bootstrapper.Web.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Codebelt.Bootstrapper.Web --version 3.0.0-preview.2                
NuGet\Install-Package Codebelt.Bootstrapper.Web -Version 3.0.0-preview.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="Codebelt.Bootstrapper.Web" Version="3.0.0-preview.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Codebelt.Bootstrapper.Web --version 3.0.0-preview.2                
#r "nuget: Codebelt.Bootstrapper.Web, 3.0.0-preview.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.
// Install Codebelt.Bootstrapper.Web as a Cake Addin
#addin nuget:?package=Codebelt.Bootstrapper.Web&version=3.0.0-preview.2&prerelease

// Install Codebelt.Bootstrapper.Web as a Cake Tool
#tool nuget:?package=Codebelt.Bootstrapper.Web&version=3.0.0-preview.2&prerelease                

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).

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

Codebelt.Bootstrapper.Web

An implementation optimized for web, webapi, webapp, razor, mvc applications.

CSharp Example

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


// --- Program.cs ---

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

// --- Startup.cs ---

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

    public override void ConfigureServices(IServiceCollection services)
    {
    }

    public override void ConfigurePipeline(IApplicationBuilder app)
    {
        if (Environment.IsLocalDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        app.UseRouting();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapGet("/", async context =>
            {
                await context.Response.WriteAsync("Hello World!");
            });
        });
    }
}

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


// --- Program.cs ---

public class Program : MinimalWebProgram
{
    static Task Main(string[] args)
    {
        var builder = CreateHostBuilder(args);

        var app = builder.Build();

        if (app.Environment.IsLocalDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        app.UseRouting();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapGet("/", async context =>
            {
                await context.Response.WriteAsync("Hello World!");
            });
        });

        return app.RunAsync();
    }
}

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible. 
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
3.0.0 76 11/13/2024
3.0.0-rc.1 49 11/11/2024
3.0.0-preview.2 52 10/13/2024
3.0.0-preview.1 48 10/7/2024
2.0.0 96 9/8/2024
1.3.0 196 2/11/2024
1.2.0 207 12/15/2023
1.1.0 630 11/9/2022
1.0.1 364 12/29/2021
1.0.0 413 5/7/2021

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 MinimalWebProgram class in the Codebelt.Bootstrapper.Web namespace that is the entry point of an application optimized for web applications
- ADDED WebApplicationBuilderExtensions class in the Codebelt.Bootstrapper.Web namespace that consist of extension methods for the WebApplicationBuilder class: UseBootstrapperLifetime
 
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
 
# Breaking Changes
- CHANGED WebStartup class in the Codebelt.Bootstrapper.Web namespace to provide a new abstraction; ConfigurePipeline(IApplicationBuilder) and removed ILogger parameter from Configure method
 
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 WebProgram class in the Codebelt.Bootstrapper.Web namespace that is the entry point of an application responsible for registering its WebStartup partner
- ADDED WebStartup class in the Codebelt.Bootstrapper.Web namespace that provides the base class of a conventional based Startup class for web applications