Pure.DI.MS 2.1.68

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Pure.DI.MS --version 2.1.68
                    
NuGet\Install-Package Pure.DI.MS -Version 2.1.68
                    
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.MS" Version="2.1.68" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.DI.MS" Version="2.1.68" />
                    
Directory.Packages.props
<PackageReference Include="Pure.DI.MS" />
                    
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.MS --version 2.1.68
                    
#r "nuget: Pure.DI.MS, 2.1.68"
                    
#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.MS&version=2.1.68
                    
Install Pure.DI.MS as a Cake Addin
#tool nuget:?package=Pure.DI.MS&version=2.1.68
                    
Install Pure.DI.MS 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

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.69 140 5/7/2025
2.1.68 136 5/6/2025
2.1.66 135 5/1/2025
2.1.65 145 4/30/2025
2.1.63 73 4/26/2025
2.1.62 95 4/25/2025
2.1.61 153 4/24/2025
2.1.60.1 147 4/24/2025
2.1.60 207 4/16/2025
2.1.59 144 2/27/2025
2.1.58 117 2/25/2025
2.1.57 132 2/20/2025
2.1.56 116 2/7/2025
2.1.55 122 2/5/2025
2.1.54 128 2/4/2025
2.1.53 113 1/25/2025
2.1.52 109 1/22/2025
2.1.51 105 1/17/2025
2.1.49 112 1/10/2025
2.1.47 127 12/27/2024
2.1.46 104 12/26/2024
2.1.45 110 12/25/2024
2.1.41 140 11/28/2024
2.1.40 109 11/21/2024
2.1.39 117 11/20/2024
2.1.36 190 9/13/2024
2.1.35 178 9/5/2024
2.1.29 102 8/2/2024
2.1.25 150 7/2/2024
2.1.24 119 6/26/2024
2.1.18 127 5/16/2024
2.1.6 240 3/14/2024
2.1.3 216 2/29/2024
2.1.0 206 2/14/2024
2.0.49 225 2/8/2024
2.0.23 4,608 11/3/2023
2.0.22 310 10/25/2023