Domore.Conf
10.4.0
See the version list below for details.
dotnet add package Domore.Conf --version 10.4.0
NuGet\Install-Package Domore.Conf -Version 10.4.0
<PackageReference Include="Domore.Conf" Version="10.4.0" />
<PackageVersion Include="Domore.Conf" Version="10.4.0" />
<PackageReference Include="Domore.Conf" />
paket add Domore.Conf --version 10.4.0
#r "nuget: Domore.Conf, 10.4.0"
#:package Domore.Conf@10.4.0
#addin nuget:?package=Domore.Conf&version=10.4.0
#tool nuget:?package=Domore.Conf&version=10.4.0
Domore.Conf
Configure .NET objects from readable key = value text or conf files. Domore.Conf populates existing objects, supports nested properties and indexed collections, and can serialize objects back to conf text.
Install the package with dotnet add package Domore.Conf.
Configure an object
using System;
using Domore.Conf.Extensions;
var settings = new AppSettings().ConfFrom(@"
AppSettings.Host = example.com
AppSettings.Port = 8080
");
Console.WriteLine(settings.Host); // example.com
Console.WriteLine(settings.Port); // 8080
var text = settings.ConfText();
public sealed class AppSettings {
public string Host { get; set; } = "localhost";
public int Port { get; set; } = 80;
}
By default, keys begin with the target type's name (AppSettings in this example). Pass key: "" to ConfFrom to use unprefixed keys instead:
var settings = new AppSettings().ConfFrom("Port = 8080", key: "");
Keys and property names are matched without regard to case. Values are converted using the invariant culture. Properties not mentioned in the text retain their existing values; an empty value such as Port = or Host = does not overwrite a property.
Read a file
Use Conf.Contain to load a file path (or conf text) into a container:
using Domore.Conf;
var settings = Conf.Contain("settings.conf").Configure(new AppSettings());
Alternatively, set Conf.Source and call Conf.Configure for the shared static container. When no source is set, Domore.Conf looks for a .conf file next to the entry application and can copy a .conf.default file into place if one exists.
To combine files, add an include directive:
@conf.include = defaults.conf
AppSettings.Port = 8080
Relative includes resolve from the containing file's directory. Later settings override earlier included settings. The default directive prefix is @conf; set Conf.Special or pass a different prefix to Conf.Contain(source, special) to change it.
Nested values and collections
For types with corresponding public properties, separate nested properties with dots and use brackets for list or dictionary entries:
AppSettings.Database.Host = db.example.com
AppSettings.Servers[0] = primary
AppSettings.Labels[region] = west
For a comma-separated value that replaces a list, annotate the property with [ConfListItems] from Domore.Conf.Converters:
using System.Collections.Generic;
using Domore.Conf;
using Domore.Conf.Converters;
public sealed class AppSettings {
[ConfListItems]
public List<string> Servers { get; set; } = new List<string>();
}
AppSettings.Servers = primary, secondary
Use [Conf("alias")] to accept another name for a property, or [Conf(ignore: true)] to exclude it from both population and serialization.
Watch a file
ConfFile can populate an object once and optionally watch the file for changes:
using Domore.Conf;
using var file = new ConfFile("settings.conf", key: null, target: settings);
file.Configure(watch: true);
The default watch delay is 1,000 ms; set file.Delay to change it. Subscribe to Configured, ConfigureError, or WatchError to handle watch events. Dispose the ConfFile when it is no longer needed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. 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 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 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 Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.6.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Domore.Conf:
| Package | Downloads |
|---|---|
|
Domore.Conf.ConfigurationManager
Do more conf in app.config |
|
|
Domore.Logs.Conf
Do more logs conf |
|
|
Domore.Conf.Cli
Do more conf CLI |
|
|
Domore.Release.Core
Do More Release Core |
|
|
Brows.Config
Brows Composition |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0 | 225 | 10/5/2026 |
| 10.6.4 | 205 | 9/28/2026 |
| 10.6.3 | 184 | 9/28/2026 |
| 10.6.2 | 187 | 9/27/2026 |
| 10.6.1 | 184 | 9/27/2026 |
| 10.6.0 | 207 | 9/27/2026 |
| 10.5.0 | 191 | 9/26/2026 |
| 10.4.0 | 363 | 9/24/2026 |
| 10.3.1 | 213 | 9/18/2026 |
| 10.2.1 | 2,651 | 1/10/2026 |
| 10.2.0 | 318 | 1/10/2026 |
| 10.1.1 | 1,169 | 10/6/2025 |
| 10.1.0 | 501 | 9/22/2025 |
| 10.0.0 | 505 | 9/19/2025 |
| 9.7.0 | 881 | 1/29/2025 |
| 9.6.0 | 473 | 1/29/2025 |
| 9.5.0 | 486 | 1/24/2025 |
| 9.4.0.111 | 470 | 1/15/2025 |
| 9.3.0.110 | 548 | 12/12/2024 |
| 9.2.0.109 | 592 | 9/6/2024 |