VolocyNazad.ValueStore 1.0.1

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

Toolkit.ValueStore

License: MIT VolocyNazad

A file-backed DI settings store with YAML serialization and change notifications.

Toolkit.ValueStore — a service for storing typed settings in a file (YAML by default), with atomic writes, optional tracking of external file changes, and subscriber notifications. Does not depend on the Revit API — despite its origin (extracted from revit.linter), it's a regular .NET library suitable for any application.

Features

  • IValueStore<T> — CurrentValue, Update(Action<T> change), OnChange(Action<T> listener).
  • Persistence to a file (the default serializer is YamlValueStoreSerializer, swappable via IValueStoreSerializer).
  • Atomic writes (temp file + File.Replace) and resilience to a temporarily locked file (retry with a pause).
  • Optional tracking of external file changes (FileSystemWatcher + polling) with subscriber notification via OnChange.
  • IValueStoreNotificationSource.OnLoadFailed — notifications about load/deserialization errors, replaying the last error to new subscribers.
  • The file name is configurable via [StoreFile("name.yml")] on the settings class, or via ValueStoreOptions.FileNameFactory.
  • One-line DI registration: AddValueStore(...) / AddValueStore<TSerializer>(...).

Installation

dotnet add package VolocyNazad.ValueStore

Usage

DI registration:

using Microsoft.Extensions.DependencyInjection;
using Toolkit.ValueStore.DI;
using Toolkit.ValueStore.Serialization;

services.AddValueStore<YamlValueStoreSerializer>(options =>
{
    options.DirectoryPath = Path.Combine(
        Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
        "MyApp");
    options.WatchForExternalChanges = true;
});

Settings and usage:

using Toolkit.ValueStore.Abstractions;

[StoreFile("my-settings.yml")]
public sealed class MySettings
{
    public bool IsEnabled { get; set; }
}

public sealed class MyService(IValueStore<MySettings> store)
{
    public void Toggle() => store.Update(s => s.IsEnabled = !s.IsEnabled);
}

Handling file load errors (e.g. malformed YAML):

using Toolkit.ValueStore.Abstractions;

public sealed class SettingsErrorNotifier(IValueStoreNotificationSource source) : IDisposable
{
    private readonly IDisposable _subscription = source.OnLoadFailed(args =>
        Console.WriteLine($"Failed to load {args.FilePath}: {args.Exception.Message}"));

    public void Dispose() => _subscription.Dispose();
}

Requirements

  • .NET SDK 10.0.103+ (see global.json)
  • net48 or net8.0-windows

License

MIT, see LICENSE.md.

Development documentation

Contributing

Read CONTRIBUTING.md before submitting changes.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 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.0.1 143 9/14/2026
1.0.0 107 8/31/2026