CasCap.Common.Extensions.Diagnostics.HealthChecks 4.16.0

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

CasCap.Common.Extensions.Diagnostics.HealthChecks

Custom ASP.NET Core health check base classes for monitoring HTTP endpoint availability.

Installation

dotnet add package CasCap.Common.Extensions.Diagnostics.HealthChecks

Target frameworks: netstandard2.0, net8.0, net9.0, net10.0

Usage

Implement IHealthCheckConfig and supply it to a derived check. This ASP.NET Core example registers an HTTP client and exposes the check through the standard health endpoint:

using System.Collections.Generic;
using System.Net.Http;
using CasCap.Common.Diagnostics.HealthChecks;
using CasCap.Common.Diagnostics.HealthChecks.Abstractions;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton<IHealthCheckConfig>(new EndpointConfig());
builder.Services.AddHttpClient<EndpointHealthCheck>();
builder.Services.AddHealthChecks().AddCheck<EndpointHealthCheck>("upstream");

var app = builder.Build();
app.MapHealthChecks("/healthz");
app.Run();

public sealed record EndpointConfig : IHealthCheckConfig
{
    public string HealthCheckUri { get; init; } = "https://example.com/health";
    public IReadOnlyList<int> HealthCheckExpectedHttpStatusCodes { get; init; } = [200];
}

public sealed class EndpointHealthCheck(
    ILogger<EndpointHealthCheck> logger,
    HttpClient client,
    IHealthCheckConfig config) : HttpEndpointCheckBase(logger, client, config, "Upstream");

Replace the example URI with the caller's endpoint through application configuration. The base class sends a GET and reports healthy only for an expected status; ConnectionActive tracks the last result. Configure timeouts on the injected HttpClient.

Configuration Examples

The library does not bind a fixed JSON section. Your application supplies IHealthCheckConfig, either directly as above or by binding its own options.

Property Minimal value Customized example
HealthCheckUri Required endpoint URI https://example.com/ready
HealthCheckExpectedHttpStatusCodes [200] [200, 204]

On .NET Standard 2.0, implement both properties. On .NET 8+, the interface supplies [200] when the status list is not overridden.

Kubernetes Probe Tags

KubernetesProbeTypes.GetTags() maps probe flags to ready, live and startup strings for use with health-check registration and endpoint predicates. Tagging a check does not create Kubernetes probes or configure HTTP health endpoints.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on CasCap.Common.Extensions.Diagnostics.HealthChecks:

Package Downloads
CasCap.Common.Caching

Helper library for local and remote object caching.

CasCap.Api.SignalCli

Typed .NET client for the signal-cli REST API with REST polling and JSON-RPC WebSocket transports, webhook endpoints, health checks, and INotifier integration.

CasCap.Api.Knx

.NET client library for KNX building automation — connects via KNXnet/IP tunnelling or routing, monitors group-address telegrams, and fans events out to configurable sinks.

CasCap.Api.DoorBird

.NET client library for DoorBird IP video door station — captures doorbell, motion and RFID events via the local LAN API and dispatches them to configurable sinks.

CasCap.Api.Fronius

.NET client library for Fronius solar inverter monitoring — samples power-flow data via the local Solar API v1 and dispatches readings to configurable sinks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.16.0 0 10/21/2026
4.15.0 180 10/6/2026
4.14.4 259 10/4/2026
4.14.3 175 9/28/2026
4.14.2 319 9/25/2026
4.14.1 383 9/23/2026
4.14.0 632 9/19/2026
4.13.0 309 9/15/2026
4.12.8 341 9/10/2026
4.12.7 160 9/4/2026
4.12.6 165 9/1/2026
4.12.5 245 8/20/2026
4.12.4 347 8/18/2026
4.12.3 392 7/15/2026
4.12.2 400 6/26/2026
4.12.1 377 6/14/2026
4.12.0 364 6/12/2026
4.11.9 374 6/10/2026
4.11.8 310 5/27/2026
4.11.7 191 5/27/2026
Loading failed