Pure.DI.Abstractions
2.1.59
Prefix Reserved
dotnet add package Pure.DI.Abstractions --version 2.1.59
NuGet\Install-Package Pure.DI.Abstractions -Version 2.1.59
<PackageReference Include="Pure.DI.Abstractions" Version="2.1.59" />
paket add Pure.DI.Abstractions --version 2.1.59
#r "nuget: Pure.DI.Abstractions, 2.1.59"
// Install Pure.DI.Abstractions as a Cake Addin #addin nuget:?package=Pure.DI.Abstractions&version=2.1.59 // Install Pure.DI.Abstractions as a Cake Tool #tool nuget:?package=Pure.DI.Abstractions&version=2.1.59
Pure.DI is a compile-time dependency injection (DI) code generator. Supports .NET starting with .NET Framework 2.0, released 2005-10-27, and all newer versions.
Usage Requirements
- .NET SDK 6.0.4+
Required for compilation. Projects can target older frameworks (e.g., .NET Framework 2.0). - C# 8+
Only required for projects using the Pure.DI source generator. Other projects support any C# version.
Key Features
✔️ Zero Overhead
Pure.DI is a .NET code generator designed to produce clean, efficient dependency injection logic. By leveraging basic language constructs, it generates straightforward code indistinguishable from manual implementation—essentially composing objects through nested constructor invocations. Unlike traditional DI frameworks, Pure.DI avoids reflection and dynamic instantiation entirely, eliminating performance penalties associated with runtime overhead.
✔️ Compile-Time Validation
All analysis of object, constructor, and method graphs occurs at compile time. Pure.DI proactively detects and alerts developers to issues such as missing dependencies, cyclic references, or dependencies unsuitable for injection—ensuring these errors are resolved before execution. This approach guarantees that developers cannot produce a program vulnerable to runtime crashes caused by faulty dependency wiring. The validation process operates seamlessly alongside code development, creating an immediate feedback loop: as you modify your code, Pure.DI verifies its integrity in real time, effectively delivering tested, production-ready logic the moment changes are implemented.
✔️ Works everywhere
The pure dependency injection approach introduces no runtime dependencies and avoids .NET reflection , ensuring consistent execution across all supported platforms. This includes the Full .NET Framework 2.0+, .NET Core, .NET 5+, UWP/Xbox, .NET IoT, Unity, Xamarin, Native AOT, and beyond. By decoupling runtime constraints, it preserves predictable behavior regardless of the target environment.
✔️ Familiar Syntax
The Pure.DI API is intentionally designed to closely mirror the APIs of mainstream IoC/DI frameworks. This approach ensures developers can leverage their existing knowledge of dependency injection patterns without requiring significant adaptation to a proprietary syntax.
✔️ Precise Generics
Pure.DI recommends utilizing dedicated marker types rather than relying on open generics. This approach enables more precise construction of object graphs while allowing developers to fully leverage the capabilities of generic types.
✔️ Transparency
Pure.DI allows to view and debug the generated code, making debugging and testing easier.
✔️ Built-in BCL Support
Pure.DI provides native support for numerous Base Class Library (BCL) types out of the box without any extra effort.
When to Use Pure.DI
✔️ High-Performance Applications
Pure.DI is designed for high-performance applications where speed and minimal memory consumption are critical.
✔️ Projects with a Focus on Clean Code
Pure.DI is suitable for projects where code cleanliness and minimalism are important factors.
✔️ Applications with Complex Dependencies
Pure.DI can handle complex dependencies and provides flexible configuration options.
✔️ Ideal for Libraries
Its high performance, zero memory consumption/preparation overhead, and lack of dependencies make it ideal for building libraries and frameworks.
NuGet packages
NuGet package | Description |
---|---|
Pure.DI | DI source code generator |
Pure.DI.Abstractions | Abstractions for Pure.DI |
Pure.DI.Templates | Template package, for creating projects from the shell/command line |
Pure.DI.MS | Add-ons on Pure.DI to work with Microsoft DI |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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 is compatible. 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 is compatible. 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. |
.NET Core | netcoreapp1.0 is compatible. netcoreapp1.1 is compatible. netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 is compatible. netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
.NET Standard | netstandard1.0 is compatible. netstandard1.1 is compatible. netstandard1.2 is compatible. netstandard1.3 is compatible. netstandard1.4 is compatible. netstandard1.5 is compatible. netstandard1.6 is compatible. netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net20 is compatible. net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Windows Phone | wp8 was computed. wp81 was computed. wpa81 was computed. |
Windows Store | netcore was computed. netcore45 was computed. netcore451 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 1.0
- Microsoft.NETCore.App (>= 1.0.5)
-
.NETCoreApp 1.1
- Microsoft.NETCore.App (>= 1.1.2)
-
.NETCoreApp 2.0
- No dependencies.
-
.NETCoreApp 2.1
- No dependencies.
-
.NETCoreApp 2.2
- No dependencies.
-
.NETCoreApp 3.0
- No dependencies.
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 1.0
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.1
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.2
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.4
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.5
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.6
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
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 |
---|---|---|
2.1.59 | 96 | 2/27/2025 |
2.1.58 | 85 | 2/25/2025 |
2.1.57 | 91 | 2/20/2025 |
2.1.56 | 93 | 2/7/2025 |
2.1.55 | 91 | 2/5/2025 |
2.1.54 | 92 | 2/4/2025 |
2.1.53 | 97 | 1/25/2025 |
2.1.52 | 82 | 1/22/2025 |
2.1.51 | 77 | 1/17/2025 |
2.1.49 | 82 | 1/10/2025 |
2.1.47 | 101 | 12/27/2024 |
2.1.46 | 89 | 12/26/2024 |
2.1.45 | 102 | 12/25/2024 |
2.1.41 | 96 | 11/28/2024 |
2.1.40 | 93 | 11/21/2024 |
2.1.39 | 103 | 11/20/2024 |
2.1.36 | 139 | 9/13/2024 |
2.1.35 | 126 | 9/5/2024 |
2.1.29 | 100 | 8/2/2024 |
2.1.25 | 110 | 7/2/2024 |
2.1.24 | 100 | 6/26/2024 |