Using Simple Injector with SignalR

Well, I tried yesterday and I’ve found a solution. According to me, the only moment where I want dependency injection in SignalR is for my hubs: I don’t care about how SignalR is working inside ! So instead of replacing the DependencyResolver, I created my own implementation of IHubActivator : public class SimpleInjectorHubActivator : IHubActivator … Read more

Constructor injection with Quartz.NET and Simple Injector

According to this blog post, you would need to implement a custom IJobFactory, like this: public class SimpleInjectorJobFactory : IJobFactory { private readonly Container container; private readonly Dictionary<Type, InstanceProducer> jobProducers; public SimpleInjectorJobFactory( Container container, params Assembly[] assemblies) { this.container = container; // By creating producers, jobs can be decorated. var transient = Lifestyle.Transient; this.jobProducers = … Read more

Avoiding all DI antipatterns for types requiring asynchronous initialization

This is a long answer. There’s a summary at the end. Scroll down to the summary if you’re in a hurry. The problem you have, and the application you’re building, is a-typical. It’s a-typical for two reasons: you need (or rather want) asynchronous start-up initialization, and Your application framework (azure functions) supports asynchronous start-up initialization … Read more

Simple Injector unable to inject dependencies in Web API controllers

TLTR: the problem is caused by the implicit way Web API handles resolving controller types; register your Web API controllers explicitly and you’ll see where the problem is. Here is a step by step what is happening under the covers: The System.Web.Http.DefaultHttpControllerActivator calls into the SimpleInjectorWebApiDependencyResolver and requests the creation of an API controller. SimpleInjectorWebApiDependencyResolver … Read more

Simple Injector vs Hiro vs Autofac [closed]

Let me start by saying that I’m the lead developer behind Simple Injector. I agree with Mark that in most cases performance of a container isn’t a problem. Still, some containers perform very poor at some points and it can be hard to intuitively sense what parts of the configuration can be problematic from a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)