Medo.Config 1.2.1

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

Medo.Config

Simple, file-backed configuration handling for .NET applications.

Medo.Config provides a small API for reading and writing application settings and runtime state, with sensible defaults for config file locations on Windows and Linux.

Features

  • User configuration with system configuration file as a fallback
  • Preserves comments and general formatting when possible
  • Thread-safe access
  • Separate state file
  • Separate recent files handling

Installation

Install from NuGet:

dotnet add package Medo.Config

Quick Start

using Medo;

var lastRun = Config.Read("LastRun", DateTime.MinValue);
Config.Write("LastRun", DateTime.UtcNow);

See examples/ConfigExample for a minimal usage sample. See examples/RecentExample for a recent file handling example.

Default File Locations

By default, application name is inferred from assembly metadata (AssemblyProduct, then AssemblyTitle, then assembly name).

On Windows:

  • System: %ProgramData%\[ApplicationName]\[ApplicationName].conf
  • User: %AppData%\[ApplicationName]\[ApplicationName].conf
  • State: %AppData%\[ApplicationName]\[ApplicationName].state
  • Recent: %AppData%\[ApplicationName]\[ApplicationName].recent

On Linux/macOS and other non-Windows platforms:

  • System: /etc/[applicationname]/[applicationname].conf
  • User: $XDG_CONFIG_HOME/[applicationname]/[applicationname].conf (or ~/.config/[applicationname]/[applicationname].conf)
  • State: $XDG_STATE_HOME/[applicationname]/[applicationname].state (or ~/.local/state/[applicationname]/[applicationname].state)
  • Recent: $XDG_STATE_HOME/[applicationname]/[applicationname].recent (or ~/.local/state/[applicationname]/[applicationname].recent)

Note: non-Windows defaults normalize app name to lowercase.

File Format

Configuration and State

Configuration files use a properties-style text format:

# Sample config
Theme: dark
ItemCount: 100
Path: /opt/b
  • : and = separators are supported
  • repeated keys are supported (use ReadMany)
  • values are stored as UTF-8 (without BOM)
  • comments beginning with # are supported

Recent

Recent file storage uses one file name per line in UTF-8 (without BOM) file:

/file1.txt
/file2.txt

Custom Initialization

If needed, provide explicit paths:

using Medo;

Config.Initialize(
		userConfigPath: "/home/app/.config/myapp.conf",
		systemConfigPath: "/etc/myapp.conf",
		stateConfigPath: "/home/app/.local/state/myapp.state"),
		recentPath: "/home/app/.local/state/myapp.recent");

Pass null for any path that is not needed.

Product Compatible and additional computed target framework versions.
.NET 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 Framework net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8.1

    • No dependencies.
  • net10.0

    • No dependencies.

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.1 42 4/1/2026
1.2.0 78 3/30/2026
1.1.0 82 3/30/2026
1.0.0 78 3/29/2026

CHANGELOG

Changelog at https://github.com/medo64/Medo.Config/blob/main/CHANGELOG.md


[1.2.1] (2026-04-01)

- Added .NET 4.8.1 support


[1.2.0] (2026-03-30)

- Added Decimal support
- Added Windows system-wide config (ProgramData)
- Fixed round-trip DateTime parsing
- Better preservation of in-line comments


[1.1.0] (2026-03-29)

- Fixed Delete and Clear file update
- Added a few additional shortcut methods


[1.0.0] (2026-03-29)

- First release


[unreleased]: https://github.com/medo64/Medo.Config
[1.2.1]: Medo.Config/1.2.1
[1.2.0]: Medo.Config/1.2.0
[1.1.0]: Medo.Config/1.1.0
[1.0.0]: Medo.Config/1.0.0