Eigenverft.WebLib.Middleware.Primitives
1.0.0.5-g40a2f17cdc
dotnet add package Eigenverft.WebLib.Middleware.Primitives --version 1.0.0.5-g40a2f17cdc
NuGet\Install-Package Eigenverft.WebLib.Middleware.Primitives -Version 1.0.0.5-g40a2f17cdc
<PackageReference Include="Eigenverft.WebLib.Middleware.Primitives" Version="1.0.0.5-g40a2f17cdc" />
<PackageVersion Include="Eigenverft.WebLib.Middleware.Primitives" Version="1.0.0.5-g40a2f17cdc" />
<PackageReference Include="Eigenverft.WebLib.Middleware.Primitives" />
paket add Eigenverft.WebLib.Middleware.Primitives --version 1.0.0.5-g40a2f17cdc
#r "nuget: Eigenverft.WebLib.Middleware.Primitives, 1.0.0.5-g40a2f17cdc"
#:package Eigenverft.WebLib.Middleware.Primitives@1.0.0.5-g40a2f17cdc
#addin nuget:?package=Eigenverft.WebLib.Middleware.Primitives&version=1.0.0.5-g40a2f17cdc&prerelease
#tool nuget:?package=Eigenverft.WebLib.Middleware.Primitives&version=1.0.0.5-g40a2f17cdc&prerelease
Eigenverft.WebLib.Middleware.Primitives
Small ASP.NET Core building blocks for middleware composition, isolated pipeline branches, typed request features, and explicit response writing.
β¨ At a glance
| Capability | What it does |
|---|---|
| Pipeline | MapIsolated and MapRemaining create non-rejoining branches. |
| Infrastructure | UseMiddlewareOnce, CreateUseSiteOptionsMonitor, and EnsureServicesRegistered support reusable middleware. |
| Features and responses | Typed HttpContext feature helpers and WriteHtmlStatusResponseAsync. |
π¦ Installation
dotnet add package Eigenverft.WebLib.Middleware.Primitives
π Quick start
Split static subtrees from the application shell
using Eigenverft.WebLib.Middleware.Primitives.Pipeline;
using Microsoft.AspNetCore.Builder;
app.MapIsolated("/apps", apps =>
{
apps.UseDefaultFiles();
apps.UseStaticFiles();
});
app.MapRemaining(shell =>
{
shell.UseRouting();
shell.UseEndpoints(endpoints => endpoints.MapGet("/", () => "application shell"));
});
Package behavior
MapIsolated preserves the matched path segment for normal static-file middleware and prevents the branch from rejoining the remaining pipeline. It disables an already-active status-code-pages feature for that request, so branch-owned 404 handling cannot re-execute into the application shell. Declare all isolated mappings before MapRemaining. MapRemaining is an always-matching, non-rejoining branch with a normal IApplicationBuilder; endpoint routing stays in UseRouting and UseEndpoints.
UseMiddlewareOnce<TMiddleware>() avoids a second convention-based middleware registration in the same linear pipeline. ASP.NET Core branch builders inherit markers established before the branch; markers added inside a branch remain local. The helper does not deduplicate across rejoining pipeline graphs.
CreateUseSiteOptionsMonitor<TOptions>(configure) creates a reload-aware options monitor for one middleware use. It builds from registered configure and post-configure steps, applies the local override, then validates. The local monitor has its own cache and does not change global options. EnsureServicesRegistered<TService>(...) checks required registrations without activating services.
The Features namespace provides GetFeature, GetRequiredFeature, TryGetFeature, SetFeature, RemoveFeature, and GetOrCreateFeature helpers over HttpContext.Features.
WriteHtmlStatusResponseAsync(statusCode) writes a minimal HTML status page using ASP.NET Coreβs reason phrase and HTML encoding. Use it for explicit middleware short-circuits; general application error handling belongs in Status Code Pages or Problem Details.
This package has no package dependencies. Eigenverft.WebLib.CanonicalHostRedirect builds on its middleware option helpers and includes this package transitively.
π― Target frameworks
Targets .NET 8 and .NET 10. A .NET 9 application can consume the compatible net8.0 asset.
π Project links
π License
Licensed under the MIT License by Eigenverft.
| Product | Versions 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 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.5-g40a2f17cdc | 0 | 9/28/2026 |
| 1.0.0.5-g3f72d1412c | 0 | 9/29/2026 |
| 1.0.0.2-gbfce1c5596 | 0 | 9/28/2026 |
| 1.0.0.2-g8afd56e9dc | 0 | 9/12/2026 |
Initial capability package extracted from Eigenverft.WebLib.Infrastructure.
- ASP.NET Core middleware and request-pipeline primitives, typed HTTP context features, response helpers, and service registration utilities.
- Public namespaces and behavior remain compatible with the original Infrastructure implementation.