CSV file storage provider for OutWit.Common.Settings. Enables storing settings in tabular CSV format, ideal for spreadsheet editing and external tool processing.
$ dotnet add package OutWit.Common.Settings.CsvOutWit.Common.Settings.Csv is a CSV file storage provider for the OutWit.Common.Settings framework. It enables storing and loading application settings in tabular CSV format, ideal for scenarios where settings need to be easily editable in spreadsheet applications or processed by external tools.
Use the UseCsv() extension method to configure CSV storage with conventional defaults:
var manager = new SettingsBuilder()
.UseCsv() // Uses {AppContext.BaseDirectory}/Resources/settings.csv
.RegisterContainer<NetworkSettings>()
.Build();
manager.Merge();
manager.Load();
Specify custom paths for defaults and scope-specific files:
var manager = new SettingsBuilder()
.UseCsv("path/to/defaults.csv")
.Build();
Or add individual CSV files for specific scopes:
builder.UseCsvFile("config/global-settings.csv", SettingsScope.Global);
builder.UseCsvFile("config/user-settings.csv", SettingsScope.User);
Settings are stored in a simple tabular format with the following columns:
Group,Key,Value,ValueKind,Tag,Hidden
NetworkSettings,ApiEndpoint,http://localhost:5000,ServiceUrl,,False
NetworkSettings,ProxyUrl,,Url,,False
NetworkSettings,ConnectionTimeout,00:00:30,TimeSpan,,False
NetworkSettings,MaxRetries,3,Integer,,False
Columns:
Group - Settings group nameKey - Setting key/property nameValue - Serialized valueValueKind - Type identifier for deserializationTag - Optional metadata (e.g., enum type for Enum values)Hidden - Whether to hide from UIGroup metadata can be stored in a separate file ():
settings.groups.csvGroup,DisplayName,Priority
NetworkSettings,Network,0
Security,Security Settings,5CSV format allows easy editing in Excel, Google Sheets, or any text editor.
Install the package via NuGet:
Install-Package OutWit.Common.Settings.CsvDependencies:
OutWit.Common.SettingsCsvHelperLicensed under the Apache License, Version 2.0. See LICENSE.
If you use OutWit.Common.Settings.Csv in a product, a mention is appreciated (but not required), for example: "Powered by OutWit.Common.Settings.Csv (https://ratner.io/)".
"OutWit" and the OutWit logo are used to identify the official project by Dmitry Ratner.
You may:
You may not: