Me.Toolkit.Maui.Configuration 26.9.14

dotnet add package Me.Toolkit.Maui.Configuration --version 26.9.14
                    
NuGet\Install-Package Me.Toolkit.Maui.Configuration -Version 26.9.14
                    
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="Me.Toolkit.Maui.Configuration" Version="26.9.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Me.Toolkit.Maui.Configuration" Version="26.9.14" />
                    
Directory.Packages.props
<PackageReference Include="Me.Toolkit.Maui.Configuration" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Me.Toolkit.Maui.Configuration --version 26.9.14
                    
#r "nuget: Me.Toolkit.Maui.Configuration, 26.9.14"
                    
#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.
#:package Me.Toolkit.Maui.Configuration@26.9.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Me.Toolkit.Maui.Configuration&version=26.9.14
                    
Install as a Cake Addin
#tool nuget:?package=Me.Toolkit.Maui.Configuration&version=26.9.14
                    
Install as a Cake Tool

Me.Toolkit.Maui.Configuration

appsettings.json for .NET MAUI apps, from the app package or from embedded resources, with the usual appsettings.{environment}.json overlay.

Ported from Xamarinme.Configuration.

Use

Mark the file as a MauiAsset:

<ItemGroup>
  <MauiAsset Include="appsettings.json" />
  <MauiAsset Include="appsettings.Development.json" />
</ItemGroup>

Then, in MauiProgram:

using Me.Toolkit.Maui.Configuration;

var builder = MauiApp.CreateBuilder();
builder.Configuration.AddAppPackageJson(environment: "Development");

Or keep the file as an EmbeddedResource, which is what Xamarinme did:

builder.Configuration.AddEmbeddedResourceJson(
    typeof(App).Assembly, prefix: "MyApp", environment: "Development");

prefix is the default namespace plus any folders the file sits in, dot-separated — MyApp.res for a file in a res folder.

Both take optional: false if a missing file should throw rather than be skipped, and the exception names the file and where it looked.

What this adds over plain MAUI

MAUI references Microsoft.Extensions.Configuration but not the JSON provider, so builder.Configuration has no AddJsonStream. That is what this package supplies, along with the environment overlay and the two ways of finding the file. The parsing is Microsoft's.

Xamarinme vendored a copy of Microsoft's Newtonsoft-era JsonConfigurationFileParser — the one Microsoft replaced with a System.Text.Json implementation in .NET Core 3.0 — and froze it there, with a Newtonsoft.Json dependency attached. Nothing is vendored here.

One behavioural difference from Xamarinme.Configuration is worth knowing: a JSON null used to read as "", so the key existed; it is now absent, and GetValue<T> falls back to the default. Booleans still render "True" — both parsers do that, so a string comparison against "true" was always wrong. Use GetValue<bool>.

Documentation

Full documentation is in the wikiDesign Notes for why each library is shaped the way it is, Building and Testing for the multi-targeting rules, and Publishing for how these packages are released.

Source: github.com/melihercan/Me.Toolkit.Maui

Licence

MIT.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-maccatalyst26.0 is compatible.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net10.0-windows10.0.19041 is compatible. 
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
26.9.14 79 9/14/2026
26.9.9 85 9/8/2026

26.9.9 renames the assemblies and namespaces to match the package ID. 26.9.8 shipped the correct package ID around assemblies still called Mauime.*, so consuming it meant writing using Mauime.X against a package called Me.Toolkit.Maui.X; it is unlisted. Nothing else changed.
First release. Replaces Xamarinme.Configuration 1.0.2, which was for Xamarin.
AddAppPackageJson reads a MauiAsset; AddEmbeddedResourceJson reads an embedded resource, which is the path Xamarinme offered and still works. Both layer appsettings.{environment}.json over the base file, and both name the file and where they looked when a required one is missing.
Parsing is Microsoft.Extensions.Configuration.Json's. Xamarinme vendored a copy of Microsoft's Newtonsoft-era parser and froze it there, with a Newtonsoft.Json dependency attached. Nothing is vendored here.
One behavioural difference from Xamarinme.Configuration: a JSON null used to read as an empty string, so the key existed; it is now absent, and binding falls back to the default. Booleans still render "True" - both parsers do that, so a string comparison against "true" was always wrong.
The options object is gone, and with it the three ways it could be left half-filled and produce a NullReferenceException out of Build, or, for a wrong prefix, an empty configuration and no error at all.