Simple Injector
An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success. (by simpleinjector)
Scrutor
Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection (by khellang)
Our great sponsors
Simple Injector | Scrutor | |
---|---|---|
4 | 16 | |
1,183 | 3,406 | |
- | - | |
5.8 | 0.0 | |
about 1 month ago | about 1 month ago | |
C# | C# | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Simple Injector
Posts with mentions or reviews of Simple Injector.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-03-25.
-
Modular Dependency Injection in .NET
When I was building application with .NET Framework I always used libraries like Autofac and SimpleInjector for dependency injection. I really liked to create modules (Packages in SimpleInjector) to achieve higher cohesion and lower coupling in my class libraries. I made a module for every class library in which all dependencies inside of that class library were registered. Why should my web application (for example) know if MyBeautifulService in MyBeautifulClassLibrary should be transient or singleton?
- How to do dependency injection based on HttpContext values?
-
Chicken and Egg problem - being able to overwrite the config file and the class it instantiates
You can use SimpleInjector library to do that. Link: https://github.com/simpleinjector/SimpleInjector
-
Does anybody has a recommended resource about Dependency Injection?
My favorite DI container is LightInject. Very fast and has all the features that I need. Other good DI containers are Grace and SimpleInjector, IMO.
Scrutor
Posts with mentions or reviews of Scrutor.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-06-03.
- Reflection -> Source Generated
-
Why asp.net core is not popular like Spring boot or nodejs, although it's better than both in all aspects?
You can with MS's default DI as well via scrutor.
- C# Design Patterns: Implementing the decorator pattern
-
Migrating to .Net Core MVC from .Net framework 4.8
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
-
ModuleLoader vs Reference
If you wouldn't mind, I have one additional question. If I wouldn't bother to remove this loading, how could one add that as service when using DI? I have found tool called Scrutor (https://github.com/khellang/Scrutor), is it something commonly used in situation like this?
-
Would you use an attribute that registers your interface/classes with .nets IoC container?
I much prefer using Scrutor and asbly scanning myself. https://github.com/khellang/Scrutor
-
Dependency Injection
you can also use Scrutor to get closer to Autofac functionality https://github.com/khellang/Scrutor
-
You Probably Don't Need to Worry About MediatR
That can't be the only justification, because you can easily register services using reflection without using MediatR.
-
A new small opensource library - Autojector.
I might suggest additional registration time extensions to modify the behavior as needed on classes. Take a look at Scrutor for some inspiration on API specifically.
-
6 .NET Myths Dispelled — Celebrating (Almost) 21 Years of .NET
There is a package that simplifies it for you if you want. But not everybody agrees that automatic registration is good pattern, so you have a choice.
What are some alternatives?
When comparing Simple Injector and Scrutor you can also consider the following projects:
Autofac - An addictive .NET IoC container
Microsoft.Extensions.DependencyInjection
Lamar - Fast Inversion of Control Tool and Successor to StructureMap
Unity - This repository contains all relevant information about Unity Container suit
Ninject - the ninja of .net dependency injectors
DryIoc - DryIoc is fast, small, full-featured IoC Container for .NET
LightInject - An ultra lightweight IoC container
FluentValidation.Blazor - Fluent Validation-powered Blazor component for validating standard <EditForm> :milky_way: :white_check_mark:
Simple Injector vs Autofac
Scrutor vs Autofac
Simple Injector vs Microsoft.Extensions.DependencyInjection
Scrutor vs Lamar
Simple Injector vs Unity
Scrutor vs Microsoft.Extensions.DependencyInjection
Simple Injector vs Ninject
Scrutor vs Unity
Simple Injector vs DryIoc
Scrutor vs DryIoc
Simple Injector vs LightInject
Scrutor vs FluentValidation.Blazor