Euhen.AppBuilder.Web 2.1.0

dotnet add package Euhen.AppBuilder.Web --version 2.1.0
                    
NuGet\Install-Package Euhen.AppBuilder.Web -Version 2.1.0
                    
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="Euhen.AppBuilder.Web" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Euhen.AppBuilder.Web" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Euhen.AppBuilder.Web" />
                    
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 Euhen.AppBuilder.Web --version 2.1.0
                    
#r "nuget: Euhen.AppBuilder.Web, 2.1.0"
                    
#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 Euhen.AppBuilder.Web@2.1.0
                    
#: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=Euhen.AppBuilder.Web&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Euhen.AppBuilder.Web&version=2.1.0
                    
Install as a Cake Tool

Euhen.AppBuilder.Web

ASP.NET Core extension package for building modular web applications. Extends Euhen.AppBuilder with support for middleware pipeline configuration via pipeline modules.

Installation

dotnet add package Euhen.AppBuilder.Web

How it works

EuhenWebAppBuilder extends EuhenAppBuilder with pipeline module support. It wraps WebApplicationBuilder and coordinates both service registration and middleware pipeline configuration. Service modules are applied immediately upon registration. Pipeline modules are queued and applied in registration order when Build() is called, after the WebApplication has been constructed.

Getting started

Step 1 — Create a module

The recommended approach is to implement IModule, which combines both IServiceModule and IPipelineModule. This allows you to group all configuration logic for a feature — services and pipeline — in a single class.

using Euhen.AppBuilder.Web.Modules;

public class AuthModule : IModule
{
    public void Configure(IHostApplicationBuilder builder)
    {
        builder.Services.AddAuthentication();
        builder.Services.AddAuthorization();
    }

    public void Configure(WebApplication app)
    {
        app.UseAuthentication();
        app.UseAuthorization();
    }
}

When a feature only involves service registration and no pipeline configuration, implement IServiceModule from Euhen.AppBuilder and use AddServiceModule instead.

When a feature only involves pipeline configuration, implement IPipelineModule and use AddPipelineModule.

Step 2 — Register the module in Program.cs

Use EuhenWebAppBuilder and register your modules with AddModule. Call Build() to finalise the application.

You can construct EuhenWebAppBuilder in two ways:

  • Pass args directly — args is the variable automatically available in Program.cs that contains the command-line arguments passed to the application. EuhenWebAppBuilder will create the WebApplicationBuilder internally.
  • Pass an existing WebApplicationBuilder or IHostApplicationBuilder.
var app = new EuhenWebAppBuilder(args)
    .AddModule(new AuthModule())
    .Build();

app.Run();

When custom configuration is needed outside of a module, use ConfigureServices and ConfigurePipelines to apply inline configuration directly:

var app = new EuhenWebAppBuilder(args)
    .AddModule(new AuthModule())
    .ConfigureServices(b => b.Services.AddControllers())
    .ConfigurePipelines(a => a.MapControllers())
    .Build();

app.Run();

Terminology

Term Description
EuhenWebAppBuilder Extends EuhenAppBuilder with pipeline module support. Wraps WebApplicationBuilder and exposes Build().
IServiceModule Contract for a module that registers services into the DI container. Configure is called immediately when the module is added. Defined in Euhen.AppBuilder.
IPipelineModule Contract for a module that configures the ASP.NET Core middleware pipeline. Configure is called in Build(), after WebApplication has been constructed.
IModule Combines IServiceModule and IPipelineModule. The preferred way to define a web feature module.
AddModule Registers an IModule: immediately applies service configuration and queues pipeline configuration for Build().
AddServiceModule Registers and immediately applies an IServiceModule without pipeline configuration.
AddPipelineModule Queues an IPipelineModule to be applied during Build().
Build() Finalises the WebApplicationBuilder, applies all registered pipeline modules in order, and returns the configured WebApplication.

License

This project is licensed under the MIT License.

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

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
2.1.0 261 4/6/2026
2.0.0 127 4/6/2026
1.0.0 124 4/6/2026
0.1.0 124 4/6/2026