Awaiten.Extensions.DependencyInjection
0.16.0
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
dotnet add package Awaiten.Extensions.DependencyInjection --version 0.16.0
NuGet\Install-Package Awaiten.Extensions.DependencyInjection -Version 0.16.0
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="Awaiten.Extensions.DependencyInjection" Version="0.16.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Awaiten.Extensions.DependencyInjection" Version="0.16.0" />
<PackageReference Include="Awaiten.Extensions.DependencyInjection" />
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 Awaiten.Extensions.DependencyInjection --version 0.16.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Awaiten.Extensions.DependencyInjection, 0.16.0"
#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 Awaiten.Extensions.DependencyInjection@0.16.0
#: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=Awaiten.Extensions.DependencyInjection&version=0.16.0
#tool nuget:?package=Awaiten.Extensions.DependencyInjection&version=0.16.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Awaiten.Extensions.DependencyInjection
Awaiten.Extensions.DependencyInjection bridges an Awaiten container into Microsoft.Extensions.DependencyInjection, so ASP.NET Core, the generic host and worker services resolve its services. You keep Awaiten's compile-time checked graph and still fit the host.
Installation
dotnet add package Awaiten
dotnet add package Awaiten.Extensions.DependencyInjection
Reference Awaiten directly as well: it carries the source generator that builds your container.
At a glance
using Awaiten;
using Awaiten.Extensions.DependencyInjection;
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.Services.AddAwaitenContainer<CoffeeShop.Root>() // project the container into the service collection
.WithInitialization(); // warm async services on startup
WebApplication app = builder.Build();
app.Services.VerifyAwaitenContainers(); // every imported host service is registered
app.MapPost("/orders/{drink}", (string drink, Order order) => order.Add(drink));
app.Run();
[Container(AsyncSafety = AsyncSafety.SyncAfterInit)]
[Singleton<PriceList>]
[Scoped<Order>] // one per request
[ImportService<ILogger<Order>>] // provided by the host
public static partial class CoffeeShop;
Three ways to plug in
| API | Pick it when |
|---|---|
services.AddAwaitenContainer<TRoot>() |
You add the container to a service collection, such as builder.Services, or migrate from MS.DI one group of services at a time |
new AwaitenServiceProviderFactory<TRoot>() |
The host builds its provider through a factory, and imported services should resolve from the root before anything else |
new AwaitenServiceProvider(root) |
Nothing but the container registers services, so it answers every request itself |
Features
- Aligned lifetimes and scopes. Awaiten lifetimes map to
ServiceLifetime, and one Awaiten scope aligns to each MS.DI scope, such as an ASP.NET Core request. - Host services in the graph.
[ImportService<T>]and[ImportServices]let the container depend on host registrations, andVerifyAwaitenContainers()checks at startup that they exist. - Async initialization. An async-initialized service is projected as
Task<T>;WithInitialization()warms the container on startup, and underAsyncSafety.SyncAfterInitconsumers take the bare type. - Keyed services. Keyed registrations are projected under their key, so
[FromKeyedServices]andGetKeyedServicereach them. - Disposal once. Awaiten disposes everything it built exactly once, with the scope that owns it, including dependencies MS.DI never sees.
- ASP.NET Core feature detection.
AwaitenServiceProvideranswersIServiceProviderIsService, so minimal APIs and MVC tell injected parameters from request data. - Native AOT. The bridge constructs no generic types at run time.
Documentation
The full documentation is available at awaiten.dev:
- MS.DI bridge: the three paths, disposal, startup initialization and verification, and what the bridge does not project
- External services: importing host services into the container
- Migrating from MS.DI: moving an existing
IServiceCollectionsetup to Awaiten, one group of services at a time - Getting started with Awaiten itself
| 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-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 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. |
| .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. |
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Awaiten (>= 0.16.0)
- Microsoft.Bcl.AsyncInterfaces (>= 11.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
-
net10.0
- Awaiten (>= 0.16.0)
- Microsoft.Bcl.AsyncInterfaces (>= 11.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
-
net8.0
- Awaiten (>= 0.16.0)
- Microsoft.Bcl.AsyncInterfaces (>= 11.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
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 |
|---|---|---|
| 0.16.0 | 95 | 11/15/2026 |
| 0.15.0 | 96 | 11/15/2026 |
| 0.14.0 | 100 | 11/13/2026 |
| 0.13.0 | 92 | 11/11/2026 |
| 0.12.0 | 93 | 11/9/2026 |
| 0.11.0 | 100 | 11/7/2026 |
| 0.10.0 | 90 | 11/6/2026 |
| 0.9.0 | 97 | 11/4/2026 |
| 0.8.0 | 104 | 10/30/2026 |
| 0.7.0 | 154 | 7/21/2026 |
| 0.6.0 | 127 | 7/17/2026 |
| 0.5.0 | 127 | 7/15/2026 |
| 0.4.0 | 130 | 7/8/2026 |
| 0.3.0 | 133 | 7/6/2026 |
| 0.2.0 | 134 | 7/4/2026 |
| 0.1.0 | 138 | 6/28/2026 |
| 0.0.1 | 139 | 6/27/2026 |