C# Dependency Injection

Open-source C# projects categorized as Dependency Injection

Top 23 C# Dependency Injection Projects

  • Autofac

    An addictive .NET IoC container

    Project mention: "7D Mad Rogue Kart" post-mortem | reddit.com/r/roguelikedev | 2023-03-12

    For the first shot, I wanted to manually web the systems together. For the next iteration, I might go with an IoC framework like Autofac.

  • Scrutor

    Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection

    Project mention: Migrating to .Net Core MVC from .Net framework 4.8 | reddit.com/r/dotnet | 2023-01-24

    if you are heavily invested in autofac you can replace the build in DI with another container. at this point i don't think it is that necessary. especially if you use scrutor. it gives your some nice assembly scanning registration that autofac/simple injector give https://github.com/khellang/Scrutor

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • Simple Injector

    An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.

  • jab

    C# Source Generator based dependency injection container implementation.

    Project mention: Injectio - Source Generator for Dependency Injection | reddit.com/r/csharp | 2022-11-04
  • DryIoc

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

    Project mention: Announcing .NET 8 Preview 1 | reddit.com/r/dotnet | 2023-02-21

    I'd like to keep the convention-based assembly scanning capabilities if ever that was possible. It's too convenient and less error prone than manually registering everything through attributes like current source generator strategies go. DryIocZero supports this somewhat using t4 templates, it gives you a method where you can register your stuff and do assembly scanning and it'll generate your container from there. It works and is quite small and fast but the UX does need some work since t4 is rather clunky to write on.

  • Device.Net

    A C# cross platform connected device framework

  • Reflex

    Minimal dependency injection framework for Unity (by gustavopsantos)

    Project mention: Reflex now supports SceneContext | reddit.com/r/Unity3D | 2022-08-29

    Enjoy! https://github.com/gustavopsantos/Reflex

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • Meet Grace

    Grace is a feature rich dependency injection container library (by ipjohnson)

  • Extenject

    Dependency Injection Framework for Unity Game Engine (by Mathijs-Bakker)

    Project mention: Overview of clean architecture in Unity? | reddit.com/r/unity | 2022-11-10

    A lot of your problems can be solved by using a proper dependency injection framework like this: https://github.com/Mathijs-Bakker/Extenject.

  • FluentValidation.Blazor

    Fluent Validation-powered Blazor component for validating standard <EditForm> :milky_way: :white_check_mark:

  • Pure.DI

    Pure DI for .NET without frameworks!

  • Autofac.Extensions.DependencyInjection

    Autofac implementation of the interfaces in Microsoft.Extensions.DependencyInjection.Abstractions, the .NET Core dependency injection abstraction.

  • Prism.Avalonia

    Prism framework support for Avalonia UI

    Project mention: For a simple desktop app, would you choose MAUI or Avalonia? | reddit.com/r/dotnet | 2023-03-12
  • Stashbox

    A lightweight, fast, and portable dependency injection framework for .NET-based solutions.

  • xaml-code-experiences

    A collection of the experiences I have collected during days of Xamarin and Wpf, while following the MVVM design pattern.

  • Medicine

    Code-driven component injection toolkit for Unity.

  • di-framework

    ↗ A Dependency Injection framework for Unity game engine.

  • Simplify.DI

    Simplify is an open-source set of .NET libraries that provide infrastructure for your applications. DI and mocking friendly. (by SimplifyNet)

  • xunit-dependency-injection

    :fire: A small library to help .net developers leverage Microsoft's dependency injection framework in their test projects powered by Xunit

  • lazy-proxy-serviceprovider

    Lazy Dependency Injection for Microsoft's DI ServiceProvider

  • AdaptiveClient.EntityFrameworkCore

    Utility classes and methods for using AdaptiveClient to work with DBContext and other Entity Framework Core objects. Build loosely coupled services, readily accessible via a lightweight façade. Easily build your service layer to use multiple providers (MSSQL, MySQL, SQLite) with no additional infrastructure. Use connection string objects to as keys to resolve specific implementations of DbContext for migrations and testing.

  • ManualDi.Main

    Dependency injection library for C#

  • ManualDi.Unity3d

    Extensions and usability features of the ManualDi dependency injection library for the Unity3d game engine

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-03-12.

C# Dependency Injection related posts


What are some of the best open-source Dependency Injection projects in C#? This list will help you:

Project Stars
1 Autofac 4,105
2 Scrutor 2,862
3 Simple Injector 1,123
4 jab 861
5 DryIoc 827
6 Device.Net 547
7 Reflex 325
8 Meet Grace 315
9 Extenject 285
10 FluentValidation.Blazor 220
11 Pure.DI 192
12 Autofac.Extensions.DependencyInjection 163
13 Prism.Avalonia 144
14 Stashbox 119
15 xaml-code-experiences 115
16 Medicine 62
17 di-framework 31
18 Simplify.DI 17
19 xunit-dependency-injection 14
20 lazy-proxy-serviceprovider 11
21 AdaptiveClient.EntityFrameworkCore 5
22 ManualDi.Main 5
23 ManualDi.Unity3d 4
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives