ReloadableConfiguration 1.1.0

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

ReloadableConfiguration

An ASP .NET Core class library for defining reloadable configuration repositories that periodically reload their contents to reflect data changes made by others.

NuGet NuGet

Installation:

  • from NuGet;
  • from package manager console:
Install-Package ReloadableConfiguration
  • from command line:
dotnet add package ReloadableConfiguration

Usage:

  • The source of reloadable configuration repository provider should have PeriodicalReload property set to true. This may be done by calling WithPeriodicalReload() extension method on source configurator.
  • A ConfigurationReloader hosted service should be registered in service collection using AddConfigurationReloader() extension method.

Examples:

The following sample explains how to define a configuration repository that is periodically reloaded to update it`s configuration if provider data changes. A working example you may find in ReloadableRepository.ParsableInMemory sample project on github.

using ConfigurationRepository;
using Microsoft.AspNetCore.Builder;

var builder = WebApplication.CreateBuilder(args);

// Define our json configuration data.
var configJsonData = """{"JSON KEY": "JSON VALUE"}""";

// Create repository object with this data.
var repository = new InMemoryJsonRepository(configJsonData);

// Define our parsable json configuration provider with in-memory repository.
// Also configure configuration source that this configuration with be reloadable
// by ConfigurationReloader hosting servce.
builder.Configuration.AddParsableRepository(
    repository,
    configureSource: source => source.WithPeriodicalReload());

// Next call does two things:
// 1. Registers ConfigurationReloader hosted service in service collection.
// This hosted service periodically reloads it`s configuration providers.
// 2. Registers reloadable configuration service with builder.Configuration
// for ConfigurationReloader. This tells ConfigurationReloader wich providers
// he should serve.
// FYI: Reload period of 0.5 second is just for quick sample results.
builder.Services.AddConfigurationReloader(
    builder.Configuration,
    TimeSpan.FromSeconds(0.5));

var app = builder.Build();

app.Run();

// In memory configuration repository that takes a json and returns
// it to a configuration parser. JsonConfig can be set outside to
// simulate external repository changes. This class just demonstrates
// a minimal parsable repository implementation.
class InMemoryJsonRepository(string jsonConfig)
    : IConfigurationRepository
{
    public string JsonConfig { get; set; } = jsonConfig;

    public TData GetConfiguration<TData>()
    {
        return (TData)Convert.ChangeType(JsonConfig, typeof(TData));
    }
}

The complete example you may find in ReloadableRepository.ParsableInMemory project on github.

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 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 (2)

Showing the top 2 NuGet packages that depend on ReloadableConfiguration:

Package Downloads
ConfigurationRepository

Configuration repository provider for building .NET Core application`s configuration stored in databases or other storages.

ParametrizedConfiguration

Parametrized configuration provider. A configuration that may contain parameter placeholders replaceable with values. Parameter values substitute with keys from the same configuration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.2 120 7/9/2025
1.1.1 138 7/1/2025
1.1.0 142 6/29/2025