Eigenverft.NetLib.Configuration.Sources 1.0.0.5-g17613f8942

This is a prerelease version of Eigenverft.NetLib.Configuration.Sources.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Eigenverft.NetLib.Configuration.Sources --version 1.0.0.5-g17613f8942
                    
NuGet\Install-Package Eigenverft.NetLib.Configuration.Sources -Version 1.0.0.5-g17613f8942
                    
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="Eigenverft.NetLib.Configuration.Sources" Version="1.0.0.5-g17613f8942" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eigenverft.NetLib.Configuration.Sources" Version="1.0.0.5-g17613f8942" />
                    
Directory.Packages.props
<PackageReference Include="Eigenverft.NetLib.Configuration.Sources" />
                    
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 Eigenverft.NetLib.Configuration.Sources --version 1.0.0.5-g17613f8942
                    
#r "nuget: Eigenverft.NetLib.Configuration.Sources, 1.0.0.5-g17613f8942"
                    
#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 Eigenverft.NetLib.Configuration.Sources@1.0.0.5-g17613f8942
                    
#: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=Eigenverft.NetLib.Configuration.Sources&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Eigenverft.NetLib.Configuration.Sources&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Tool

Eigenverft.NetLib.Configuration.Sources

NuGet Version NuGet Downloads Repository CI Targets License

Reset a host builder's configuration providers to environment variables and, optionally, the current process command line. Add application-specific sources afterward.

✨ At a glance

Package Eigenverft.NetLib.Configuration.Sources
Main API ResetToMinimalConfigurationSources(...)
Builder IHostApplicationBuilder
Defaults Environment variables on; command-line arguments off
Target frameworks .NET 8 and .NET 10
License MIT

📦 Installation

dotnet add package Eigenverft.NetLib.Configuration.Sources

🚀 Quick start

Call the reset before adding custom configuration providers:

using Eigenverft.NetLib.Configuration.Sources;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;

HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.ResetToMinimalConfigurationSources(
    includeCommandLineArguments: true);

builder.Configuration.AddJsonFile(
    "appsettings.json",
    optional: true,
    reloadOnChange: true);

using IHost host = builder.Build();
await host.RunAsync();

The method returns the same builder for chaining. Its defaults retain environment variables and omit command-line arguments; the example opts into both. Since the reset clears the existing source collection, call it before adding sources you want to keep.

🧭 Source order and behavior

The method removes all existing configuration sources, including the host builder's defaults. It then adds environment variables first and, when requested, command-line arguments second, so command-line values have higher precedence than environment variables. Any custom provider added after the reset is later in the stack and can take higher precedence.

When command-line arguments are enabled, the helper reads the current process arguments with Environment.GetCommandLineArgs() and skips the executable path. It does not take an argument array parameter.

After registering the sources you want to retain, use Configuration.Diagnostics to inspect their final precedence.

🎯 Target frameworks

The package targets net8.0 and net10.0.

📄 License

MIT License

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.5-gdfdd996480 0 9/29/2026
1.0.0.5-g17613f8942 0 9/29/2026
1.0.0.3-g28e841270d 0 9/28/2026
1.0.0.2-gbac57d8b97 0 9/11/2026
1.0.0.2-g9537b96514 0 9/11/2026

Initial capability package extracted from Eigenverft.NetLib.Infrastructure.