Shiny.Extensions.Configuration
1.1.1
Prefix Reserved
See the version list below for details.
dotnet add package Shiny.Extensions.Configuration --version 1.1.1
NuGet\Install-Package Shiny.Extensions.Configuration -Version 1.1.1
<PackageReference Include="Shiny.Extensions.Configuration" Version="1.1.1" />
<PackageVersion Include="Shiny.Extensions.Configuration" Version="1.1.1" />
<PackageReference Include="Shiny.Extensions.Configuration" />
paket add Shiny.Extensions.Configuration --version 1.1.1
#r "nuget: Shiny.Extensions.Configuration, 1.1.1"
#:package Shiny.Extensions.Configuration@1.1.1
#addin nuget:?package=Shiny.Extensions.Configuration&version=1.1.1
#tool nuget:?package=Shiny.Extensions.Configuration&version=1.1.1
Xamarin Configuration for Microsoft.Extensions.Configuration
Nugets
| Release | NuGet |
|---|---|
| Stable | |
| Preview |
Builds
| Branch | Status |
|---|---|
| Master | |
| Dev | |
| Preview |
Features
- All the power of IConfiguration
- Load JSON from packaged sources (whitelabellers can unpack, edit, & repack the config)
- Preferences based configuration source with writebacks
- Support For
- Xamarin
- iOS
- Android
- Including Xamarin Forms 😛
- .NET 6
- Android
- iOS
- Including MAUI 😛
- Xamarin
The Problem
Microsoft really did create a great set of abstractions for configuration. You can store a set of key/values, cause a reload when a configuration source changes, & bind to strongly typed objects using Microsoft.Extensions.Configuration.Binder. On Mobile though, NONE of the current providers aren't really well.
Why?
- A big feature for IConfiguration, is the ability to trigger a reload of it's source without restarting the application. Changing an appsettings.json file during runtime causes the IConfiguration to trigger a reload notification.
- Mobile doesn't really have an appsettings.json. Sure you could put this in an embedded resource, but than it is readonly at all times other than the build process... after that - it is locked in place
- Essentially, IConfiguration becomes a string based dictionary for all intents and purposes - pretty useless considering
The Solution
How Shiny.Extensions.Configuration brings the power of IConfiguration to Mobile!
- A platform preferences configuration source which allows you to WRITE a value back using IConfiguration[key] = value;
- A whitelabellers dream - the ability to unpack, change a json config file, and repack without trigger a build by using proper platform directories to load up the JSON files while still having the power of a proper configuration library internally.
Setup
AppSettings JSON
- Install the NuGet package 'Shiny.Extensions.Configuration'
- Create an appsettings.json file like you would in ASP.NET Core application in your HEAD project.
- ANDROID: place the file in: Assets. Ensure the build action on the file is set to 'AndroidAsset'
- iOS: place the file in the ROOT of your project. Ensure the build action on the file is set to 'BundleResource'
- Configure your IConfiguration using the following code in your application startup code (ie. Xamarin.Forms App).
// store this in your dependency injection container OR static class
var config = new ConfigurationBuilder()
.AddJsonPlatformBundle() // NOTE: you can change the name of appsettings.json to something else and pass as an argument here
.Build();
Preferences Provider
This provider allows writes and persists across application restarts. It is a wrapper around the Android/iOS shared preferences.
- Install the NuGet package 'Shiny.Extensions.Configuration'
- For this configuration source, nothing special is required, simply add the following to the configuration builder:
var configuration = new ConfigurationBuilder()
.AddPlatformPreferences()
.Build();
NOTE: with the platform preferences provider, changes are supported.
IConfiguration config = ...; // build
config["key"] = "value"; // write - this will cause a persist to the platform prefs and also trigger Option reloated events
Links
| 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-android31.0 is compatible. net6.0-ios was computed. net6.0-ios15.2 is compatible. net6.0-maccatalyst was computed. net6.0-maccatalyst15.2 is compatible. 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. 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 | 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 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. monoandroid12.0 is compatible. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. xamarinios10 is compatible. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
-
MonoAndroid 12.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
- Xamarin.AndroidX.Preference (>= 1.1.1.13)
-
net6.0-android31.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
- Xamarin.AndroidX.Preference (>= 1.1.1.13)
-
net6.0-ios15.2
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
-
net6.0-maccatalyst15.2
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
-
Xamarin.iOS 1.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.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 |
|---|---|---|
| 4.1.0-beta-0108 | 33 | 4/24/2026 |
| 4.1.0-beta-0093 | 87 | 4/10/2026 |
| 4.1.0-beta-0091 | 86 | 4/10/2026 |
| 4.1.0-beta-0090 | 83 | 4/10/2026 |
| 4.1.0-beta-0086 | 83 | 4/8/2026 |
| 4.1.0-beta-0068 | 92 | 4/8/2026 |
| 4.1.0-beta-0064 | 92 | 4/7/2026 |
| 4.1.0-beta-0063 | 82 | 4/7/2026 |
| 4.1.0-beta-0052 | 87 | 4/1/2026 |
| 4.1.0-beta-0043 | 94 | 3/28/2026 |
| 4.0.1 | 286 | 3/27/2026 |
| 4.0.0 | 98 | 3/27/2026 |
| 4.0.0-beta-0111 | 86 | 3/27/2026 |
| 4.0.0-beta-0095 | 1,709 | 10/28/2025 |
| 4.0.0-beta-0093 | 217 | 9/21/2025 |
| 4.0.0-beta-0092 | 343 | 9/17/2025 |
| 4.0.0-beta-0091 | 216 | 8/18/2025 |
| 4.0.0-beta-0086 | 254 | 6/23/2025 |
| 4.0.0-beta-0084 | 218 | 6/4/2025 |
| 1.1.1 | 10,020 | 3/3/2022 |