Skip to main content
DryIoc package icon

DryIoc

v6.0.0-preview-08Latest Pre-release
.NETFramework4.5.NETStandard2.1.NETStandard2.0

DryIoc is fast, small, full-featured IoC Container for .NET

Published
Oct 27, 2024
2y ago
Total Downloads
5.2M
5,237,161

Install

dotnet add package DryIoc --version 6.0.0-preview-08
ProductVersions
.NET Standard
netstandard2.0netstandard2.1
Other
.NETFramework4.5

README

Hello Sailor,

Compile-time Dependency Injection

DryIoc has an optional compile-time Dependency Injection with the source package (previously it was available as a separate DryIocZero package).

You may ignore this information if you don't want to use the compile-time DI. Everything will work without it, but wait... you will like some compile-time DI!

How to use [@WIP]

  1. Copy contents of "%USERPROFILE%.nuget\packages\DryIoc\CompileTimeDI" folder to your project, e.g. "Container.Generated.tt", "CompileTimeRegistrations.ttinclude", and "CompileTimeRegistrations.Example.cs".
  2. Add your registrations into the "CompileTimeRegistrations.ttinclude" file, the file already contains the registrations from the "CompileTimeGenerate.Example.cs", you may remove them or use it as a guideline.
  3. [@WIP] Save (or re-save) the "Container.Generated.tt" file in the Visual Studio or JetBrains Rider (you may get a prompt - accept it). If everything is fine you will see the generated "Container.Generated.cs" file under the "Container.Generated.tt" in Solution Explorer. The "Container.Generated.cs" will contain the generated methods to create the services registered in "CompileTimeRegistrations.ttinclude"

T4 Text Template Transformation Tooling

First you may install the dotnet-t4 CLI tool from NuGet to play and experiment with templates.

For editing and viewing the T4 text template files you may use:

Changes from Previous Version

No structural changes between v6.0.0-preview-07 and v6.0.0-preview-08.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.