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
<PackageReference Include="Medo.Config" Version="1.2.1" />
<PackageVersion Include="Medo.Config" Version="1.2.1" />
<PackageReference Include="Medo.Config" />
paket add Medo.Config --version 1.2.1
#r "nuget: Medo.Config, 1.2.1"
#:package Medo.Config@1.2.1
#addin nuget:?package=Medo.Config&version=1.2.1
#tool nuget:?package=Medo.Config&version=1.2.1
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 | Versions 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. |
-
.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.
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