Asv.Cfg
Asv.Cfg stores typed configuration objects under string keys. It provides a common API for in-memory values, a folder of JSON files, a single JSON file, a package part, and ZIP entries. All public types use the Asv.Cfg namespace.
Installation
The project currently targets net10.0 through src/Directory.Build.props. It uses Newtonsoft.Json, R3 notifications, Asv.Common lifetime helpers, and file-system abstractions.
First configuration
The type-based overload uses ConnectionSettings as its key. Loading an absent key stores the default object. Changing the returned object alone does not save it: call Set or Update explicitly.
Choose a backend
Backend | Representation | Appropriate use |
|---|---|---|
| JSON tokens held in memory | Tests and temporary settings |
| One | Independently editable configuration sections |
| One JSON object containing all keys | A single application settings file |
| One JSON object in a | Settings embedded in an existing package |
| One | Portable ZIP settings bundles |
| ZIP settings plus | Bundles with a file type and maximum supported version |
These backends share operations, but differ in notifications on default creation, persistence timing, and ownership. Choose based on the details below rather than assuming they are interchangeable in every respect.
Guides
Configuration serialization is not encryption. Keep credentials in an appropriate secret store and avoid writing configuration values to logs.
Source and verification
Sources are under src/Asv.Cfg; tests are under src/Asv.Cfg.Test.