Any-Config
1.0.135
See the version list below for details.
dotnet add package Any-Config --version 1.0.135
NuGet\Install-Package Any-Config -Version 1.0.135
<PackageReference Include="Any-Config" Version="1.0.135" />
paket add Any-Config --version 1.0.135
#r "nuget: Any-Config, 1.0.135"
// Install Any-Config as a Cake Addin #addin nuget:?package=Any-Config&version=1.0.135 // Install Any-Config as a Cake Tool #tool nuget:?package=Any-Config&version=1.0.135
AnyConfig
A .net configuration library to make configuration of multi-target applications easier.
Description
AnyConfig makes configuration on solutions which mix .Net Core and .Net Framework projects easier. It abstracts away ConfigurationManager and IConfiguration loading with no dependencies on Microsoft implementation. You can instead use ConfigurationManager to load either json or xml configuration files, as well as the IConfiguration interface. This allows you to upgrade to json configuration files even for older projects, or have multi-target projects which use different configuration formats without extra code!
Installation
PM> Install-Package Any-Config
Features
- Backwards compatible interface using ConfigurationManager for Xml and Json
- Supports IConfiguration interface for Xml and Json
- Supports generics for simple configuration value lookups
- Automatic discovery of configuration files for .Net Core or .Net Framework projects
- Legacy Xml encrypted sections (DPAPI and RSA) are supported
- [todo] Yaml support coming soon
Usage
Simplest usage is using the dedicated generics interface:
var isEnabled = Config.Get<bool>("IsEnabled");
You can specify a default value for settings that aren't required to exist:
var intValue = Config.Get<int>("Port", 443);
You can also bind your own configuration class:
var testConfiguration = Config.Get<MyTestConfiguration>();
Grab an IConfiguration for .net core without any Microsoft extensions:
var config = Config.GetConfiguration();
var testConfiguration = config.Get<MyTestConfiguration>();
If you need, use the legacy ConfigurationManager:
var isEnabled = ConfigurationManager.AppSettings["IsEnabled"];
The built-in ConfigurationManager supports generics:
var isEnabled = ConfigurationManager.AppSettings["IsEnabled"].As<bool>();
It also supports reading from json:
ConfigurationManager.ConfigurationFilename = "appsettings.json";
var isEnabled = ConfigurationManager.AppSettings["IsEnabled"].As<bool>();
// appsettings.json
{
"IsEnabled": true
}
Advanced Usage
See the wiki
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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- ILRepack.Lib.MSBuild.Task (>= 2.0.18.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 5.0.0)
-
.NETStandard 2.0
- ILRepack.Lib.MSBuild.Task (>= 2.0.18.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 5.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 | Downloads | Last updated |
---|---|---|
1.0.165 | 6,687 | 11/16/2021 |
1.0.164 | 793 | 11/15/2021 |
1.0.161 | 872 | 11/1/2021 |
1.0.160 | 896 | 11/1/2021 |
1.0.159 | 805 | 11/1/2021 |
1.0.157 | 823 | 11/1/2021 |
1.0.155 | 840 | 10/22/2021 |
1.0.152 | 841 | 10/20/2021 |
1.0.149 | 829 | 10/7/2021 |
1.0.147 | 872 | 10/7/2021 |
1.0.145 | 3,102 | 7/29/2021 |
1.0.136 | 861 | 2/16/2021 |
1.0.135 | 886 | 2/4/2021 |
1.0.134 | 913 | 2/4/2021 |
1.0.130 | 903 | 2/4/2021 |
1.0.122 | 7,694 | 2/4/2021 |
1.0.114 | 4,569 | 7/10/2020 |
1.0.113 | 1,076 | 7/10/2020 |
1.0.112 | 2,520 | 7/10/2020 |
1.0.110 | 1,102 | 7/10/2020 |
1.0.109 | 1,045 | 7/9/2020 |
1.0.108 | 1,045 | 7/9/2020 |
1.0.105 | 1,105 | 6/22/2020 |
1.0.103 | 1,130 | 6/9/2020 |
1.0.102 | 1,091 | 6/2/2020 |
1.0.101 | 1,035 | 6/2/2020 |
1.0.99 | 1,059 | 5/30/2020 |
1.0.98 | 1,067 | 5/30/2020 |
1.0.97 | 1,060 | 5/30/2020 |
1.0.95 | 1,102 | 5/29/2020 |
1.0.91 | 1,035 | 5/7/2020 |
1.0.90 | 1,029 | 5/5/2020 |
1.0.78 | 1,812 | 5/2/2020 |
1.0.77 | 1,112 | 5/1/2020 |
1.0.76 | 1,042 | 5/1/2020 |
1.0.75 | 1,045 | 5/1/2020 |
1.0.72 | 1,015 | 5/1/2020 |
1.0.70 | 1,025 | 4/30/2020 |
1.0.69 | 1,064 | 4/24/2020 |
1.0.68 | 1,018 | 4/24/2020 |
1.0.67 | 1,001 | 4/24/2020 |
1.0.66 | 1,065 | 4/23/2020 |
1.0.65 | 1,029 | 4/23/2020 |
1.0.64 | 1,044 | 4/20/2020 |
1.0.62 | 1,000 | 4/20/2020 |
1.0.60 | 1,004 | 4/20/2020 |
1.0.58 | 994 | 4/18/2020 |
1.0.48 | 1,158 | 4/14/2020 |
1.0.47 | 978 | 4/14/2020 |
1.0.44 | 997 | 4/14/2020 |
1.0.42 | 992 | 4/14/2020 |
1.0.41 | 1,040 | 4/14/2020 |
1.0.40 | 1,025 | 4/14/2020 |
1.0.39 | 1,039 | 4/14/2020 |
1.0.38 | 935 | 4/14/2020 |
1.0.37 | 990 | 4/14/2020 |
1.0.36 | 1,052 | 4/13/2020 |
1.0.35 | 1,071 | 4/10/2020 |
1.0.29 | 1,073 | 4/9/2020 |
1.0.28 | 1,116 | 4/8/2020 |
1.0.25 | 1,143 | 4/8/2020 |
1.0.16 | 1,060 | 4/7/2020 |
1.0.9 | 1,059 | 4/4/2020 |
1.0.0 | 1,099 | 4/3/2020 |
A .net configuration library to make configuration of multi-target applications easier