A fast, small, and full-featured Inversion of Control container for .NET applications.
DryIoc is a fast, small, and full-featured Inversion of Control container for .NET. It manages dependency injection in applications by automating object creation, lifetime management, and service resolution. It solves the problem of tightly coupled code by promoting loose coupling and testability through dependency injection patterns.
.NET developers building applications that require efficient dependency management, particularly those working on performance-sensitive projects or needing advanced features like open generics, decorators, and complex object graphs.
Developers choose DryIoc for its exceptional performance, minimal memory footprint, and comprehensive feature set. Its design emphasizes low-ceremony usage, extensibility, and reliability, making it a strong alternative to other .NET IoC containers.
DryIoc is fast, small, full-featured IoC Container for .NET
DryIoc outperforms competitors like Autofac and Grace in benchmarks, with up to 27x faster hot-run and 5x faster cold-start times, and lower memory allocation, as shown in the README's detailed metrics.
It supports advanced DI patterns such as open generics, decorators, wrappers (e.g., Lazy, Func, collections), and conditional registrations, enabling management of complex object graphs.
With over 2000 test cases, thread-safe lock-free operations, and built-in cycle detection, DryIoc ensures robust error handling and stable service resolution in multi-threaded environments.
It targets multiple .NET versions from Framework 4.5 to .NET 9 and offers interpretation mode for platforms like Xamarin iOS where System.Reflection.Emit is unavailable, ensuring broad compatibility.
The documentation is auto-generated via CsToMd, which can be less user-friendly, and the community size is smaller than giants like Autofac, potentially hindering troubleshooting and third-party extensions.
On Xamarin iOS, DryIoc must use interpretation instead of expression compilation due to platform limitations, leading to slower resolution times compared to other supported platforms.
Seamless use with ASP.NET Core requires separate adapter packages like DryIoc.MsDI, adding setup steps and complexity versus the built-in Microsoft DI container.
DryIoc is an open-source alternative to the following products:
Lamar is a fast, lightweight, and extensible .NET IoC (Inversion of Control) container and service locator.
Grace is a graceful restart library for Go HTTP servers, enabling zero-downtime deployments.
Autofac is an open-source dependency injection (DI) container for .NET applications. It manages class dependencies and provides inversion of control to help build loosely coupled and maintainable software.
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
An addictive .NET IoC container
Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
the ninja of .net dependency injectors
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.