Pure.DI 2.0.11-beta2

Prefix Reserved
This is a prerelease version of Pure.DI.
There is a newer version of this package available.
See the version list below for details.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Pure.DI --version 2.0.11-beta2
                    
NuGet\Install-Package Pure.DI -Version 2.0.11-beta2
                    
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.0.11-beta2">
  <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.0.11-beta2" />
                    
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.0.11-beta2
                    
#r "nuget: Pure.DI, 2.0.11-beta2"
                    
#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.0.11-beta2&prerelease
                    
Install Pure.DI as a Cake Addin
#tool nuget:?package=Pure.DI&version=2.0.11-beta2&prerelease
                    
Install Pure.DI as a Cake Tool

Pure DI for .NET

NuGet License Build

Key features

Pure.DI is not a framework or library, but a source code generator for creating object graphs. To make them accurate, the developer uses a set of intuitive hints from the Pure.DI API. During the compilation phase, Pure.DI determines the optimal graph structure, checks its correctness, and generates partial class code to create object graphs in the Pure DI paradigm using only basic language constructs. The resulting generated code is robust, works everywhere, throws no exceptions, does not depend on .NET library calls or .NET reflections, is efficient in terms of performance and memory consumption, and is subject to all optimizations. This code can be easily integrated into an application because it does not use unnecessary delegates, additional calls to any methods, type conversions, boxing/unboxing, etc.

  • DI without any IoC/DI containers, frameworks, dependencies and hence no performance impact or side effects.

    Pure.DI is actually a .NET code generator. It uses basic language constructs to create simple code as well as if you were doing it yourself: de facto it's just a bunch of nested constructor calls. This code can be viewed, analyzed at any time, and debugged.

  • A predictable and verified dependency graph is built and validated on the fly while writing code.

    All logic for analyzing the graph of objects, constructors and methods takes place at compile time. Pure.DI notifies the developer at compile time about missing or ring dependencies, cases when some dependencies are not suitable for injection, etc. The developer has no chance to get a program that will crash at runtime because of some exception related to incorrect object graph construction. All this magic happens at the same time as the code is written, so you have instant feedback between the fact that you have made changes to your code and the fact that your code is already tested and ready to use.

  • Does not add any dependencies to other assemblies.

    When using pure DI, no dependencies are added to assemblies because only basic language constructs and nothing more are used.

  • Highest performance, including compiler and JIT optimization and minimal memory consumption.

    All generated code runs as fast as your own, in pure DI style, including compile-time and run-time optimization. As mentioned above, graph analysis is done at compile time, and at runtime there are only a bunch of nested constructors, and that's it. Memory is spent only on the object graph being created.

  • It works everywhere.

    Since the pure DI approach does not use any dependencies or .NET reflection at runtime, it does not prevent the code from running as expected on any platform: Full .NET Framework 2.0+, .NET Core, .NET, UWP/XBOX, .NET IoT, Xamarin, Native AOT, etc.

  • Ease of Use.

    The Pure.DI API is very similar to the API of most IoC/DI libraries. And this was a conscious decision: the main reason is that programmers don't need to learn a new API.

  • Superfine customization of generic types.

    In Pure.DI it is proposed to use special marker types instead of using open generic types. This allows you to build the object graph more accurately and take full advantage of generic types.

  • Supports the major .NET BCL types out of the box.

    Pure.DI already supports many of BCL types like Array, IEnumerable<T>, IList<T>, ISet<T>, Func<T>, ThreadLocal, Task<T>, MemoryPool<T>, ArrayPool<T>, ReadOnlyMemory<T>, Memory<T>, ReadOnlySpan<T>, Span<T>, IComparer<T>, IEqualityComparer<T> and etc. without any extra effort.

  • Good for building libraries or frameworks where resource consumption is particularly critical.

    Its high performance, zero memory consumption/preparation overhead, and lack of dependencies make it ideal for building libraries and frameworks.

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.70 300 5/21/2025
2.1.69 429 5/7/2025
2.1.68 179 5/6/2025
2.1.66 213 5/1/2025
2.1.65 184 4/30/2025
2.1.63 172 4/26/2025
2.1.61 249 4/24/2025
2.1.60 422 4/16/2025
2.1.59 921 2/27/2025
2.1.58 183 2/25/2025
2.1.57 246 2/20/2025
2.1.56 796 2/7/2025
2.1.55 175 2/5/2025
2.1.54 180 2/4/2025
2.1.53 439 1/25/2025
2.1.52 217 1/22/2025
2.1.51 396 1/17/2025
2.1.50 169 1/16/2025
2.1.49 192 1/10/2025
2.1.48 289 12/29/2024
2.1.47 205 12/27/2024
2.1.46 145 12/26/2024
2.1.45 157 12/24/2024
2.1.44 649 12/20/2024
2.1.43 166 12/19/2024
2.1.42 183 12/17/2024
2.1.41 489 11/28/2024
2.1.40 1,051 11/21/2024
2.1.39 165 11/20/2024
2.1.38 274 11/15/2024
2.1.37 1,203 11/5/2024
2.1.36 1,050 9/13/2024
2.1.35 299 9/5/2024
2.1.34 1,043 8/28/2024
2.1.33 299 8/24/2024
2.1.32 207 8/21/2024
2.1.31 326 8/12/2024
2.1.30 166 8/10/2024
2.1.28 1,122 7/24/2024
2.1.27 3,093 7/20/2024
2.1.26 137 7/20/2024
2.1.25 2,801 7/2/2024
2.1.24 2,150 6/26/2024
2.1.23 303 6/7/2024
2.1.22 846 5/23/2024
2.1.21 258 5/21/2024
2.1.20 2,060 5/20/2024
2.1.19 341 5/17/2024
2.1.18 184 5/16/2024
2.1.17 258 5/15/2024
2.1.15 459 5/7/2024
2.1.14 281 4/27/2024
2.1.11 161 4/26/2024
2.1.10 494 4/18/2024
2.1.9 438 4/13/2024
2.1.8 378 4/3/2024
2.1.7 619 3/17/2024
2.1.6 176 3/14/2024
2.1.5 419 3/8/2024
2.1.4 383 3/7/2024
2.1.3 397 2/29/2024
2.1.2 361 2/19/2024
2.1.1 184 2/16/2024
2.1.0 214 2/14/2024
2.0.49 384 2/8/2024
2.0.48 239 2/1/2024
2.0.47 408 1/21/2024
2.0.46 215 1/20/2024
2.0.45 303 1/18/2024
2.0.44 185 1/17/2024
2.0.43 179 1/17/2024
2.0.42 263 1/16/2024
2.0.41 162 1/16/2024
2.0.40 195 1/15/2024
2.0.39 395 1/12/2024
2.0.38 238 1/10/2024
2.0.37 180 1/9/2024
2.0.36 276 1/5/2024
2.0.35 340 12/29/2023
2.0.34 1,173 12/28/2023
2.0.32 191 12/27/2023
2.0.31 170 12/27/2023
2.0.30 376 12/25/2023
2.0.29 230 12/21/2023
2.0.28 162 12/21/2023
2.0.27 315 12/18/2023
2.0.26 383 12/3/2023
2.0.24 942 11/18/2023
2.0.23 918 11/3/2023
2.0.22 329 10/25/2023
2.0.21 335 10/24/2023
2.0.20 308 10/16/2023
2.0.19 698 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,047 6/22/2023
1.1.63 6,369 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 505 10/10/2022
1.1.55 868 10/2/2022
1.1.54 488 10/1/2022
1.1.53 678 9/16/2022
1.1.52 565 9/11/2022
1.1.51 518 9/9/2022
1.1.50 617 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 764 7/8/2022
1.1.44 622 6/24/2022
1.1.43 591 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,011 3/4/2022
1.1.34 521 3/4/2022
1.1.33 542 3/1/2022
1.1.32 683 2/8/2022
1.1.31 512 2/7/2022
1.1.30 518 2/7/2022
1.1.29 531 2/7/2022
1.1.28 512 2/7/2022
1.1.27 511 2/6/2022
1.1.26 601 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 418 12/2/2021
1.1.18 425 11/16/2021
1.1.17 383 11/15/2021
1.1.16 412 11/12/2021
1.1.15 400 11/12/2021
1.1.14 478 11/8/2021
1.1.13 466 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 414 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 444 9/6/2021
1.0.4 480 8/6/2021
1.0.3 451 8/3/2021
1.0.2 412 8/2/2021
1.0.1 415 7/14/2021