Gtlabs.Consul 1.4.1

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

Gtlabs.Consul

Full integration with Consul for service registration, HTTP health check, and distributed configuration loading via KV store.

Features

  • Automatic registration: Registers the service in Consul at startup, using environment information.
  • Health check: Exposes a /health endpoint for health verification.
  • Distributed configuration: Loads configuration from Consul's KV store, both global and AppId-specific.
  • Fabio integration: Supports automatic registration of the service with Fabio via the RoutePrefix configuration. The value of RoutePrefix is added as a tag in Consul, enabling Fabio to route HTTP traffic to your service.

Usage

Respect the initialization order:

var builder = WebApplication.CreateBuilder(args);
await builder.Configuration.AddConsulConfigurationAsync();
builder.Services.AddConsulRegistration(configuration);
var app = builder.Build();
app.AddConsulHealthCheck();

Required environment variables

  • CONSUL_HOST: Consul server address.
  • CONSUL_PORT: Consul server port.
  • APP_ID: Unique application identifier.
  • SERVICE_ADVERTISE_HOST: Host/IP to advertise to Consul.
  • SERVICE_ADVERTISE_PORT: Port to advertise to Consul.
  • RoutePrefix: HTTP route prefix for Fabio (added as a Consul tag).
Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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
1.4.1 39 6/9/2026
1.4.0 108 6/7/2026