Skip to main content
DryIoc package icon

DryIoc

v6.0.0Latest Stable
.NETFramework4.7.2.NETStandard2.1net8.0net10.0net11.0

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

Published
Nov 21, 2026
2d ago
Total Downloads
5.4M
5,371,726

Install

dotnet add package DryIoc --version 6.0.0
ProductVersions
.NET
net10.0net11.0net8.0
.NET Standard
netstandard2.1
Other
.NETFramework4.7.2

README

Hello Sailor,

Compile-time Dependency Injection (optional)

Compile-time DI gives faster startup, smaller footprint and AOT/trimming compatibility. Skip this section if you only need runtime DI β€” everything works without it.

On first dotnet build the package scaffolds your project:

File When copied
CompileTimeDI\Container.Generated.tt every build (refreshed from package)
CompileTimeDI\CompileTimeExampleServices.cs every build (refreshed from package)
CompileTimeDI\CompileTimeRegistrations.ttinclude first install only β€” safe to customize
CompileTimeDI\Container.Generated.cs first install only β€” regenerated by T4 on next build
.config\dotnet-tools.json first install only β€” dotnet-t4 tool

Usage

  1. Edit CompileTimeDI\CompileTimeRegistrations.ttinclude β€” add your services to GetContainerWithRegistrations() and set resolution roots.
  2. Build in Debug mode. The second build regenerates Container.Generated.cs via T4.
  3. Check Container.Generated.cs for the generated container and any warnings.
  4. Use the compile-time container (runtime registrations on the same container are the fallback):
var container = new Container(rules => rules
    .WithCompileTimeContainer(CompileTimeContainer.Instance));

Updating the package

Container.Generated.tt and CompileTimeExampleServices.cs are always refreshed. CompileTimeRegistrations.ttinclude, Container.Generated.cs, and .config\dotnet-tools.json are never overwritten.

Opting out

Add <SkipCompTimeGen>true</SkipCompTimeGen> to your project file to disable T4 regeneration.

T4 editing tools

  • VS Code: T4 Support
  • Visual Studio: ForTea (ReSharper)
  • Rider: native T4 support

Roadmap

Changes from Previous Version

v6.0.0-preview-08v6.0.0
Added Frameworks
.NETFramework4.7.2net8.0net10.0net11.0
Removed Frameworks
.NETFramework4.5.NETStandard2.0
Removed Dependencies

Adoption Assessment

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

Compatibility metadata lists 5 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.