AkiSim.Nini
2.0.0.1
dotnet add package AkiSim.Nini --version 2.0.0.1
NuGet\Install-Package AkiSim.Nini -Version 2.0.0.1
<PackageReference Include="AkiSim.Nini" Version="2.0.0.1" />
<PackageVersion Include="AkiSim.Nini" Version="2.0.0.1" />
<PackageReference Include="AkiSim.Nini" />
paket add AkiSim.Nini --version 2.0.0.1
#r "nuget: AkiSim.Nini, 2.0.0.1"
#:package AkiSim.Nini@2.0.0.1
#addin nuget:?package=AkiSim.Nini&version=2.0.0.1
#tool nuget:?package=AkiSim.Nini&version=2.0.0.1
Nini Configuration Library for OpenSim
A powerful and flexible .NET configuration library supporting multiple configuration sources including INI files, XML, Windows Registry, command-line arguments, and environment variables.
Features
Multiple Configuration Sources
- INI files (Standard, Python, Samba, MySQL, Windows styles)
- XML configuration files
- .NET App.config/Web.config files
- Windows Registry (Windows only)
- Command-line arguments
- Environment variables
Unified API: Access all configuration sources through a single, consistent interface
Type-Safe Access: Get configuration values as strings, integers, booleans, floats, doubles, and longs
Merge Support: Combine multiple configuration sources
Auto-Save: Automatically persist changes back to the configuration source
Event-Driven: Subscribe to configuration change events
Installation
dotnet add package Nini.Opensim
Quick Start
Reading an INI File
using Nini.Config;
// Load an INI file
IConfigSource source = new IniConfigSource("myconfig.ini");
// Access a configuration section
IConfig config = source.Configs["Database"];
// Get values with type conversion
string host = config.Get("host");
int port = config.GetInt("port", 3306); // with default value
bool enabled = config.GetBoolean("enabled");
Reading XML Configuration
IConfigSource source = new XmlConfigSource("myconfig.xml");
IConfig config = source.Configs["AppSettings"];
string value = config.Get("key");
Command-Line Arguments
// Parse: myapp.exe -host localhost -port 8080
IConfigSource source = new ArgvConfigSource(args);
source.AddSwitch("Settings", "host", "h");
source.AddSwitch("Settings", "port", "p");
IConfig config = source.Configs["Settings"];
string host = config.Get("host");
int port = config.GetInt("port");
Merging Configuration Sources
// Load default configuration
IConfigSource defaults = new IniConfigSource("defaults.ini");
// Override with user configuration
IConfigSource userConfig = new IniConfigSource("user.ini");
defaults.Merge(userConfig);
// Values from userConfig override defaults
IConfig config = defaults.Configs["Settings"];
Auto-Save
IConfigSource source = new IniConfigSource("config.ini");
source.AutoSave = true;
IConfig config = source.Configs["Settings"];
config.Set("lastRun", DateTime.Now.ToString());
// Automatically saved to config.ini
Configuration File Examples
INI File Format
[Database]
host = localhost
port = 3306
username = admin
enabled = true
[Logging]
level = Info
path = /var/log/app.log
XML Format
<configuration>
<configSections>
<section name="Database" type="System.Configuration.NameValueSectionHandler" />
</configSections>
<Database>
<add key="host" value="localhost" />
<add key="port" value="3306" />
</Database>
</configuration>
Platform Support
- .NET 8.0: Fully supported
- Cross-platform: Works on Windows, Linux, and macOS
- Windows Registry: Available on Windows only (marked with
[SupportedOSPlatform("windows")])
Migration from .NET Framework
Version 2.0.0 introduces breaking changes:
- Target Framework: Now requires .NET 8.0 (previously .NET Framework 4.6)
- Modern Collections: Uses
Dictionary<T,K>andList<T>instead of legacyHashtableandArrayList - Updated APIs: Deprecated APIs have been replaced with modern equivalents
- Platform Guards: Windows-specific features are properly marked
If you're upgrading from version 1.x, your existing code should work with minimal changes. The public API remains largely compatible.
Documentation
For complete documentation and advanced usage examples, visit:
OpenSim Integration
This version is specifically maintained for the OpenSim virtual world simulator. It includes optimizations and updates tailored for OpenSim's configuration needs.
License
MIT License - See LICENSE file for details
Authors
- Brent R. Matzelle (Original Author)
- Akira Sonoda (OpenSim Fork Maintainer)
Contributing
Contributions are welcome! Please submit pull requests to the GitHub repository.
| Product | Versions 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. |
-
net8.0
- System.Configuration.ConfigurationManager (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version 2.0.0.1: Fix KeyNotFoundException in OrderedList indexer when key is not found (Dictionary replaced Hashtable, breaking null-return semantics). Version 2.0.0: Migrated to .NET 8, modernized collections (Dictionary, List), removed legacy .NET Framework dependencies, updated deprecated APIs, added platform guards for Windows-specific features.