Pure.DI 2.1.72

Prefix Reserved
dotnet add package Pure.DI --version 2.1.72
                    
NuGet\Install-Package Pure.DI -Version 2.1.72
                    
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="Pure.DI" Version="2.1.72">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.DI" Version="2.1.72" />
                    
Directory.Packages.props
<PackageReference Include="Pure.DI">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 Pure.DI --version 2.1.72
                    
#r "nuget: Pure.DI, 2.1.72"
                    
#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.
#addin nuget:?package=Pure.DI&version=2.1.72
                    
Install Pure.DI as a Cake Addin
#tool nuget:?package=Pure.DI&version=2.1.72
                    
Install Pure.DI as a Cake Tool

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
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Pure.DI:

Package Downloads
Shinya.Core

Shinya.Framework

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Pure.DI:

Repository Stars
BAndysc/AvaloniaVisualBasic6
A recreation of the classic Visual Basic 6 IDE and language in C# with Avalonia
danielpalme/IocPerformance
Performance comparison of .NET IoC containers
Version Downloads Last updated
2.1.72 384 6/3/2025
2.1.71 171 6/2/2025
2.1.70 339 5/21/2025
2.1.69 620 5/7/2025
2.1.68 190 5/6/2025
2.1.66 220 5/1/2025
2.1.65 191 4/30/2025
2.1.63 176 4/26/2025
2.1.61 254 4/24/2025
2.1.60 426 4/16/2025
2.1.59 939 2/27/2025
2.1.58 186 2/25/2025
2.1.57 249 2/20/2025
2.1.56 820 2/7/2025
2.1.55 178 2/5/2025
2.1.54 184 2/4/2025
2.1.53 443 1/25/2025
2.1.52 223 1/22/2025
2.1.51 401 1/17/2025
2.1.50 177 1/16/2025
2.1.49 197 1/10/2025
2.1.48 293 12/29/2024
2.1.47 211 12/27/2024
2.1.46 149 12/26/2024
2.1.45 160 12/24/2024
2.1.44 652 12/20/2024
2.1.43 171 12/19/2024
2.1.42 187 12/17/2024
2.1.41 492 11/28/2024
2.1.40 1,054 11/21/2024
2.1.39 170 11/20/2024
2.1.38 277 11/15/2024
2.1.37 1,219 11/5/2024
2.1.36 1,055 9/13/2024
2.1.35 305 9/5/2024
2.1.34 1,046 8/28/2024
2.1.33 302 8/24/2024
2.1.32 213 8/21/2024
2.1.31 334 8/12/2024
2.1.30 168 8/10/2024
2.1.28 1,125 7/24/2024
2.1.27 3,099 7/20/2024
2.1.26 139 7/20/2024
2.1.25 2,807 7/2/2024
2.1.24 2,153 6/26/2024
2.1.23 306 6/7/2024
2.1.22 848 5/23/2024
2.1.21 262 5/21/2024
2.1.20 2,063 5/20/2024
2.1.19 344 5/17/2024
2.1.18 187 5/16/2024
2.1.17 261 5/15/2024
2.1.15 463 5/7/2024
2.1.14 285 4/27/2024
2.1.11 163 4/26/2024
2.1.10 499 4/18/2024
2.1.9 443 4/13/2024
2.1.8 382 4/3/2024
2.1.7 622 3/17/2024
2.1.6 179 3/14/2024
2.1.5 421 3/8/2024
2.1.4 385 3/7/2024
2.1.3 400 2/29/2024
2.1.2 363 2/19/2024
2.1.1 186 2/16/2024
2.1.0 218 2/14/2024
2.0.49 387 2/8/2024
2.0.48 242 2/1/2024
2.0.47 412 1/21/2024
2.0.46 221 1/20/2024
2.0.45 306 1/18/2024
2.0.44 187 1/17/2024
2.0.43 182 1/17/2024
2.0.42 266 1/16/2024
2.0.41 165 1/16/2024
2.0.40 197 1/15/2024
2.0.39 397 1/12/2024
2.0.38 241 1/10/2024
2.0.37 187 1/9/2024
2.0.36 278 1/5/2024
2.0.35 342 12/29/2023
2.0.34 1,180 12/28/2023
2.0.32 194 12/27/2023
2.0.31 173 12/27/2023
2.0.30 379 12/25/2023
2.0.29 233 12/21/2023
2.0.28 165 12/21/2023
2.0.27 317 12/18/2023
2.0.26 384 12/3/2023
2.0.24 943 11/18/2023
2.0.23 920 11/3/2023
2.0.22 329 10/25/2023
2.0.21 335 10/24/2023
2.0.20 309 10/16/2023
2.0.19 700 9/23/2023
2.0.17 268 9/22/2023
2.0.15 1,561 8/22/2023
2.0.14 743 8/11/2023
2.0.13 275 8/11/2023
2.0.12 396 8/8/2023
1.1.64 4,059 6/22/2023
1.1.63 6,456 12/29/2022
1.1.62 659 11/18/2022
1.1.61 431 11/12/2022
1.1.60 541 10/22/2022
1.1.59 549 10/16/2022
1.1.58 449 10/13/2022
1.1.57 455 10/12/2022
1.1.56 507 10/10/2022
1.1.55 872 10/2/2022
1.1.54 488 10/1/2022
1.1.53 679 9/16/2022
1.1.52 565 9/11/2022
1.1.51 519 9/9/2022
1.1.50 618 9/2/2022
1.1.49 474 9/2/2022
1.1.48 496 9/2/2022
1.1.47 675 8/17/2022
1.1.46 593 8/7/2022
1.1.45 768 7/8/2022
1.1.44 622 6/24/2022
1.1.43 594 6/19/2022
1.1.42 518 6/19/2022
1.1.41 531 6/15/2022
1.1.40 554 6/10/2022
1.1.39 595 6/9/2022
1.1.38 549 6/8/2022
1.1.37 569 6/5/2022
1.1.35 1,012 3/4/2022
1.1.34 524 3/4/2022
1.1.33 544 3/1/2022
1.1.32 685 2/8/2022
1.1.31 512 2/7/2022
1.1.30 520 2/7/2022
1.1.29 533 2/7/2022
1.1.28 512 2/7/2022
1.1.27 511 2/6/2022
1.1.26 602 2/3/2022
1.1.25 582 1/28/2022
1.1.23 510 1/27/2022
1.1.22 561 1/21/2022
1.1.21 548 1/18/2022
1.1.20 547 1/11/2022
1.1.19 421 12/2/2021
1.1.18 425 11/16/2021
1.1.17 386 11/15/2021
1.1.16 416 11/12/2021
1.1.15 400 11/12/2021
1.1.14 478 11/8/2021
1.1.13 468 11/1/2021
1.1.11 477 10/26/2021
1.1.10 393 10/20/2021
1.1.9 429 10/19/2021
1.1.8 421 10/17/2021
1.1.7 438 10/17/2021
1.1.6 415 10/17/2021
1.1.5 452 10/16/2021
1.1.4 411 10/15/2021
1.1.3 481 10/7/2021
1.1.2 411 10/6/2021
1.1.1 545 10/3/2021
1.1.0 457 9/30/2021
1.0.6 413 9/23/2021
1.0.5 604 9/6/2021
1.0.4 482 8/6/2021
1.0.3 453 8/3/2021
1.0.2 412 8/2/2021
1.0.1 415 7/14/2021