ConsulRx.Templating 1.2.0-beta02

This is a prerelease version of ConsulRx.Templating.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package ConsulRx.Templating --version 1.2.0-beta02
NuGet\Install-Package ConsulRx.Templating -Version 1.2.0-beta02
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="ConsulRx.Templating" Version="1.2.0-beta02" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConsulRx.Templating --version 1.2.0-beta02
#r "nuget: ConsulRx.Templating, 1.2.0-beta02"
#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.
// Install ConsulRx.Templating as a Cake Addin
#addin nuget:?package=ConsulRx.Templating&version=1.2.0-beta02&prerelease

// Install ConsulRx.Templating as a Cake Tool
#tool nuget:?package=ConsulRx.Templating&version=1.2.0-beta02&prerelease


License Nuget CI/CD

A set of libraries for interacting with Hashicorp's Consul from .NET. These libraries leverage the Reactive Extensions to allow you to consume Consul values as a stream so your application can react to changes very quickly.


Provides the ability to add config values into the Microsoft.Extensions.Configuration framework from Consul's KV Store and Service Catalog.

Getting started

In your Startup.cs (or equivilent bootstrapping file where you build your configuration):

Configuration = new ConfigurationBuilder()
    .AddConsul(c =>
        c.Endpoint("http://myconsulserver:8500") //defaults to localhost if you omit
         .MapHttpService("mywidgetservice", "serviceEndpoints:widget") //maps the address of the consul service mywidgetservice to the serviceEndpoints:widget config key in IConfiguration
         .MapKeyPrefix("apps/myapp", "consul") //recursively maps all keys underneath apps/myapp to live in equivilent structure under the consul section in IConfiguration
         .MapKey("shared/key1", "key1")


Similar to Hashicorp's consul-template but in .NET using Razor templates. Why? consul-template is a popular, capable and reliable solution for generating templates from consul values. Why write an alternative in .NET? After using consul-template in several production projects, I have been frustrated by the lack of flexibility of the go templates. In my experience, when trying to do anything somewhat complex, the templates become very hard to read and understand. This project is an experiment to see if I can get similar functionality as consul-template in .NET with a much more flexible templating language of Razor that is easier to write and understand.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 was computed.  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. 
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.2.0-beta03 77 9/20/2023
1.2.0-beta02 176 10/10/2022
1.2.0-beta01 111 10/10/2022

# ConsulRx
- Start targeting netstandard2.0
- Expose metadata on ServiceNode

# ConsulRx.Templating
- New package available for executing templates with consul data