UnifiedConfig 1.3.0
See the version list below for details.
dotnet add package UnifiedConfig --version 1.3.0
NuGet\Install-Package UnifiedConfig -Version 1.3.0
<PackageReference Include="UnifiedConfig" Version="1.3.0" />
paket add UnifiedConfig --version 1.3.0
#r "nuget: UnifiedConfig, 1.3.0"
// 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.
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
- compile the class library and add reference of the dlls including the "UnifiedConfig.dll" to your project.
- add using statement to your namespaces.
- 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 indexeris 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 | Versions 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. |
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
- Newtonsoft.Json (>= 12.0.3)
- System.Xml.XPath.XDocument (>= 4.3.0)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.3)
- System.Xml.XPath.XDocument (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
This release returns default value "null" if XPath error.