Cogito.Extensions.Configuration.Autofac
4.0.4
dotnet add package Cogito.Extensions.Configuration.Autofac --version 4.0.4
NuGet\Install-Package Cogito.Extensions.Configuration.Autofac -Version 4.0.4
<PackageReference Include="Cogito.Extensions.Configuration.Autofac" Version="4.0.4" />
<PackageVersion Include="Cogito.Extensions.Configuration.Autofac" Version="4.0.4" />
<PackageReference Include="Cogito.Extensions.Configuration.Autofac" />
paket add Cogito.Extensions.Configuration.Autofac --version 4.0.4
#r "nuget: Cogito.Extensions.Configuration.Autofac, 4.0.4"
#:package Cogito.Extensions.Configuration.Autofac@4.0.4
#addin nuget:?package=Cogito.Extensions.Configuration.Autofac&version=4.0.4
#tool nuget:?package=Cogito.Extensions.Configuration.Autofac&version=4.0.4
Cogito.Extensions.Configuration.Autofac
Builds IConfigurationRoot inside the Autofac container, assembled from whatever the container's
components contribute.
Why
Configuration is normally composed once at startup, before the container exists. That leaves no way for an assembly to add a source of its own without editing startup — the opposite of how the rest of a Cogito application is composed.
Install
dotnet add package Cogito.Extensions.Configuration.Autofac
Contributing a source
Register an IConfigurationBuilderConfiguration and it is applied when the root is built:
[RegisterAs(typeof(IConfigurationBuilderConfiguration))]
public class MyConfiguration : IConfigurationBuilderConfiguration
{
public void Add(IConfigurationBuilder builder) =>
builder.AddJsonFile("my.json", optional: true);
}
Resolving IConfiguration or IConfigurationRoot then gives you everything every contributor added.
Any IConfiguration already registered in the container is chained in as well, so this composes with
configuration built the ordinary way.
Binding a section to a type
builder.RegisterConfigurationBinding<MySettings>("My:Section");
or declaratively, with [RegisterConfiguration] on the settings type.
IConfigurationRootBuilder is the seam if you need control over how the root is assembled.
License
MIT.
| 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 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 is compatible. net48 was computed. 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.7.2
- Cogito.Autofac (>= 6.1.3)
- Cogito.Core (>= 3.1.37)
- Cogito.Extensions.Configuration (>= 4.0.4)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.Json (>= 10.0.12)
-
.NETStandard 2.0
- Cogito.Autofac (>= 6.1.3)
- Cogito.Core (>= 3.1.37)
- Cogito.Extensions.Configuration (>= 4.0.4)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.Json (>= 10.0.12)
-
net6.0
- Cogito.Autofac (>= 6.1.3)
- Cogito.Core (>= 3.1.37)
- Cogito.Extensions.Configuration (>= 4.0.4)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.Json (>= 10.0.12)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Cogito.Extensions.Configuration.Autofac:
| Package | Downloads |
|---|---|
|
Cogito.Extensions.Options.Configuration.Autofac
Various additions to Microsoft.Extensions.Options for Autofac. |
|
|
Cogito.ServiceFabric.Configuration.Autofac
Extensions for sourcing Microsoft.Extensions.Configuration information from Service Fabric. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.4 | 101 | 11/28/2026 |
| 4.0.3 | 763 | 9/14/2026 |
| 4.0.2 | 130 | 9/14/2026 |
| 4.0.1 | 805 | 9/10/2026 |
| 4.0.0 | 5,986 | 12/20/2024 |
| 3.0.2 | 3,442 | 11/29/2023 |
| 3.0.1 | 769 | 11/7/2023 |
| 2.1.15 | 5,851 | 7/2/2021 |
| 2.1.14 | 3,486 | 10/29/2020 |
| 2.1.12 | 16,241 | 10/18/2020 |
| 2.1.10 | 723 | 10/18/2020 |
| 2.1.9 | 834 | 8/29/2020 |
| 2.1.8 | 7,604 | 8/7/2020 |
| 2.1.7 | 751 | 8/7/2020 |
| 2.1.5 | 770 | 8/7/2020 |
| 2.1.3 | 770 | 8/7/2020 |
| 2.1.1 | 737 | 8/7/2020 |
| 2.1.0 | 840 | 6/30/2020 |
| 2.0.9 | 774 | 6/30/2020 |
| 2.0.7 | 1,695 | 3/2/2020 |