Eigenverft.NetLib.Hosting.SelfHttpWarmup 1.0.0.5-g17613f8942

This is a prerelease version of Eigenverft.NetLib.Hosting.SelfHttpWarmup.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Eigenverft.NetLib.Hosting.SelfHttpWarmup --version 1.0.0.5-g17613f8942
                    
NuGet\Install-Package Eigenverft.NetLib.Hosting.SelfHttpWarmup -Version 1.0.0.5-g17613f8942
                    
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="Eigenverft.NetLib.Hosting.SelfHttpWarmup" Version="1.0.0.5-g17613f8942" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eigenverft.NetLib.Hosting.SelfHttpWarmup" Version="1.0.0.5-g17613f8942" />
                    
Directory.Packages.props
<PackageReference Include="Eigenverft.NetLib.Hosting.SelfHttpWarmup" />
                    
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 Eigenverft.NetLib.Hosting.SelfHttpWarmup --version 1.0.0.5-g17613f8942
                    
#r "nuget: Eigenverft.NetLib.Hosting.SelfHttpWarmup, 1.0.0.5-g17613f8942"
                    
#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 Eigenverft.NetLib.Hosting.SelfHttpWarmup@1.0.0.5-g17613f8942
                    
#: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=Eigenverft.NetLib.Hosting.SelfHttpWarmup&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Eigenverft.NetLib.Hosting.SelfHttpWarmup&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Tool

Eigenverft.NetLib.Hosting.SelfHttpWarmup

NuGet Version NuGet Downloads Repository CI Targets License

Warm up an ASP.NET Core application by sending HTTP GET requests to its own endpoints once the host has started.

✨ At a glance

Capability What it does Starting point
Code-based warmup Enable one or more absolute HTTP or HTTPS targets AddSelfHttpWarmup(...)
Configuration-based warmup Bind the SelfHttpWarmup options section AddSelfHttpWarmup()
Startup timing Set an optional initial delay and per-request timeout SelfHttpWarmupOptions
Host lifecycle Wait until the application reports started; cancel in-flight requests on shutdown Hosted service

📦 Installation

dotnet add package Eigenverft.NetLib.Hosting.SelfHttpWarmup

🚀 Quick start

Use the application's actual listening URL and a lightweight endpoint that is available after startup:

using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Eigenverft.NetLib.Hosting.SelfHttpWarmup;

var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseUrls("http://localhost:5080");
builder.Services.AddSelfHttpWarmup(
    "http://localhost:5080/health",
    options =>
    {
        options.InitialDelay = TimeSpan.FromSeconds(1);
        options.RequestTimeout = TimeSpan.FromSeconds(3);
    });

var app = builder.Build();
app.MapGet("/health", () => Results.Ok());
await app.RunAsync();

The hosted service waits for ApplicationStarted, then sends each configured target sequentially with GET. The default initial delay is zero and each request has a five-second timeout.

For a lightweight liveness target, the separate Eigenverft.WebLib.HealthProbes package provides a fixed GET/HEAD /health response: GET returns 200 with OK, and HEAD returns 200 without a body. It does not invoke ASP.NET Core health checks or report dependency readiness. Either package can be used without the other.

⚙️ Configure through appsettings

Register the feature and bind the SelfHttpWarmup section:

builder.Services.AddSelfHttpWarmup();
{
  "SelfHttpWarmup": {
    "Enabled": true,
    "InitialDelay": "00:00:01",
    "RequestTimeout": "00:00:05",
    "TargetUrls": [
      "http://localhost:5080/health"
    ]
  }
}

Options binding alone leaves warmup disabled. The URL overloads and the options-action overload enable it automatically. Targets must be absolute HTTP or HTTPS URLs; invalid targets supplied through the direct URL overload are rejected during registration.

The client connects directly without a proxy, does not follow redirects, and has a one-second connection timeout per resolved address. Point it at an address and port served by this process. Request failures and timeouts are logged and do not stop the host. The package depends on Microsoft.Extensions hosting and HTTP abstractions and does not add an ASP.NET Core shared-framework dependency.

🎯 Target frameworks

  • net8.0
  • net10.0

A .NET 9 consumer can use the compatible net8.0 asset.

📄 License

MIT

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.5-gdfdd996480 0 9/29/2026
1.0.0.5-g17613f8942 0 9/29/2026
1.0.0.3-g28e841270d 0 9/28/2026
1.0.0.2-gbac57d8b97 0 9/11/2026
1.0.0.2-g9537b96514 0 9/11/2026

Initial Eigenverft.NetLib.Hosting.SelfHttpWarmup capability package extracted from the historic WebLib implementation; public namespaces and APIs remain unchanged.

- Microsoft.Extensions hosted-service helpers that warm up an application through its own HTTP endpoint.
- Public namespaces and behavior remain compatible with the original Infrastructure implementation.