UnifiedConfig 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package UnifiedConfig --version 1.3.0                
NuGet\Install-Package UnifiedConfig -Version 1.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UnifiedConfig" Version="1.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UnifiedConfig --version 1.3.0                
#r "nuget: UnifiedConfig, 1.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install UnifiedConfig as a Cake Addin
#addin nuget:?package=UnifiedConfig&version=1.3.0

// Install UnifiedConfig as a Cake Tool
#tool nuget:?package=UnifiedConfig&version=1.3.0                

UnifiedConfig

A common C# class to manipulate xml, ini and json config files with unified interfaces.

Version Downloads

Features

  • Wrapped the difference among xml, ini and json, you can access the config file without the consideration of format.
  • Provide XPath as default locating method.
  • Saving file will not change the original format.

Usage

Recommend nuget package

Install-Package UnifiedConfig

OR

  1. compile the class library and add reference of the dlls including the "UnifiedConfig.dll" to your project.
  2. add using statement to your namespaces.
  3. you can call the functions by using the following code or just read the test class.
ConfigManager config = new ConfigManager("test.ini");
Assert.Equal("5", config[@"//Default/Interval"]);

alternatively, you can directly start a project from the solution. By adding a new project into the solution, you can easily make use of the class. A unittest project is provided.

Roadmap

Issues and PRs are welcomed.

  • Support for json
  • Nuget package
  • Auto-inference the type of config file without extension detection
  • Support returning more types other than string (via ToObject<T> method)
  • Support of IEnumerable for sophisticated query
  • Support for int indexer is removed since the xpath supported already
  • Ready to go template project
  • Case-sensitive swtich for path matching
  • Return null other than throwing error if xpath not exist

Update Notes

UPDATE 2020/06/05: Return null if xpath not exists.

UPDATE 2017/07/29: Add Case-sensitive swtich for path matching

UPDATE 2017/07/25: Add Name property and fix the IEnumerable bug.

UPDATE 2017/07/24: Add IEnumerable support for sophisticated query.

UPDATE 2017/07/22: Add Auto-inference and type conversion.

UPDATE 2017/07/20: Add json support.

UPDATE 2017/07/18: Nuget package supported.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net46 was computed.  net461 was computed.  net462 was computed.  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 tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.1 1,151 6/5/2020
1.3.0 930 6/5/2020
1.2.0 1,119 6/22/2019
1.1.6 1,492 4/2/2018
1.1.5 1,545 7/29/2017
1.1.4 1,493 7/25/2017
1.1.4-alpha 1,189 7/25/2017
1.1.3 1,489 7/24/2017
1.1.2 1,374 7/22/2017
1.1.1 1,502 7/20/2017
1.1.0 1,499 7/20/2017
1.0.0 1,490 7/18/2017

This release returns default value "null" if XPath error.