SFERA.Helpers.AppSettingsJSON
1.2024.327.3
dotnet add package SFERA.Helpers.AppSettingsJSON --version 1.2024.327.3
NuGet\Install-Package SFERA.Helpers.AppSettingsJSON -Version 1.2024.327.3
<PackageReference Include="SFERA.Helpers.AppSettingsJSON" Version="1.2024.327.3" />
<PackageVersion Include="SFERA.Helpers.AppSettingsJSON" Version="1.2024.327.3" />
<PackageReference Include="SFERA.Helpers.AppSettingsJSON" />
paket add SFERA.Helpers.AppSettingsJSON --version 1.2024.327.3
#r "nuget: SFERA.Helpers.AppSettingsJSON, 1.2024.327.3"
#:package SFERA.Helpers.AppSettingsJSON@1.2024.327.3
#addin nuget:?package=SFERA.Helpers.AppSettingsJSON&version=1.2024.327.3
#tool nuget:?package=SFERA.Helpers.AppSettingsJSON&version=1.2024.327.3
Very simple helper for reading, using one single method, keys from local appsettings.json (or whatever file).
Ideal also for reading connection strings.
Here the code:
Console.WriteLine(SFERA.Helpers.AppSettingsJSON.AppSettings.Get("key1"));
Console.WriteLine(SFERA.Helpers.AppSettingsJSON.AppSettings.Get("key2", "D:\\SFERA.Helpers\\Sample\\appsettings.json"));
Console.WriteLine(SFERA.Helpers.AppSettingsJSON.ConnectionStrings.Get("cn1"));
Console.WriteLine(SFERA.Helpers.AppSettingsJSON.ConnectionStrings.Get("cn2", "D:\\SFERA.Helpers\\Sample\\appsettings.json"));
Here the appsettings.json:
{
"ConnectionStrings": {
"cn1": "Persist Security Info=True;Initial Catalog=mycatalog1;server=server.com;User Id=user;Password=pwd;Max Pool Size=500;",
"cn2": "Persist Security Info=True;Initial Catalog=mycatalog2;server=server.com;User Id=user;Password=pwd;Max Pool Size=500;"
},
"AppSettings": {
"key1": "value1",
"key2": "value2"
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net48 is compatible. net481 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SFERA.Helpers.BaseClass (>= 2.2024.301.1)
-
.NETFramework 4.8
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SFERA.Helpers.BaseClass (>= 2.2024.301.1)
-
.NETFramework 4.8.1
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SFERA.Helpers.BaseClass (>= 2.2024.301.1)
-
.NETStandard 2.1
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SFERA.Helpers.BaseClass (>= 2.2024.301.1)
-
net6.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SFERA.Helpers.BaseClass (>= 2.2024.301.1)
-
net7.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SFERA.Helpers.BaseClass (>= 2.2024.301.1)
-
net8.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SFERA.Helpers.BaseClass (>= 2.2024.301.1)
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.2024.327.3 | 265 | 3/27/2024 |
| 1.2024.327.1 | 178 | 3/27/2024 |
| 1.2023.829.1 | 420 | 8/29/2023 |
| 1.2023.214.1 | 515 | 2/14/2023 |
| 1.2021.1209.1 | 561 | 12/9/2022 |
| 1.2021.3 | 889 | 12/6/2021 |
| 1.2021.2 | 627 | 11/12/2021 |
| 1.2021.1 | 687 | 7/12/2021 |
| 1.2020.123 | 685 | 1/19/2021 |
| 1.2020.121 | 654 | 1/19/2021 |
| 1.2020.120 | 714 | 11/25/2020 |
| 1.2020.118.116 | 763 | 4/27/2020 |
| 1.2020.8.113 | 839 | 1/8/2020 |
| 1.2019.297.96 | 874 | 10/24/2019 |
| 1.2019.294.95 | 815 | 10/21/2019 |
| 1.2019.151.74 | 906 | 5/31/2019 |
| 1.2019.147.71 | 918 | 5/27/2019 |
| 1.2019.118.30 | 893 | 4/28/2019 |
| 1.2019.117.29 | 890 | 4/27/2019 |
| 1.2019.116.25 | 870 | 4/26/2019 |
| 1.2019.112.8 | 1,001 | 4/22/2019 |
Added Net8 support.