Questions tagged [light-inject]

An ultra lightweight single file Inversion of Control container for the .Net framework.

An ultra lightweight single file Inversion of Control container for the .Net framework. Use attributes to control injected dependencies. LightInject has full support for the new Windows Runtime making it a perfect choice for Windows Store Apps. Implement cross cutting concerns using the AOP capabilities of LightInject.

LightInject provides two distribution models via NuGet

96 questions
7
votes
1 answer

Winforms IOC Container - Composition Root

I've recently been dabbling a bit with IOC Containers (LightInject in my case). I've been reading that you should only need to use the container ONCE, on startup, and no where else. This is what I'm struggling to understand. If I can only reference…
The_Chud
  • 991
  • 1
  • 11
  • 24
7
votes
1 answer

SignalR server --> client call not working

I'm currently using SignalR to communicate between a server and multiple separate processes spawned by the server itself. Both Server & Client are coded in C#. I'm using SignalR 2.2.0.0 On the server side, I use OWIN to run the server. I am also…
Joel Bourbonnais
  • 2,618
  • 3
  • 27
  • 44
7
votes
1 answer

Getting Started with LightInject

I love the benchmarks on LightInject; they are insane! Way to go, you should write a book on .Net performance, I'm serious. I see the documentation. I got the dll installed. Followed that step ok. Then the next step of the documentation presumes I…
toddmo
  • 20,682
  • 14
  • 97
  • 107
7
votes
2 answers

DryIoc, LightInject experiences

I would like to use some .NET IoC container with good performance results. I read this article about IoC containers performance and DryIoc and LightInject seem to be the best. But I did not find some reviews of them especially some experiences from…
y0j0
  • 3,369
  • 5
  • 31
  • 52
5
votes
2 answers

Automocking with LightInject plus Nsubstitute, how?

I am new to both libraries and before committing to their usage on a large project I need clarification on my options for low-code effort automocking in my unit tests. After spending some time on Google I have concluded that, unlike some other…
camelCase
  • 1,549
  • 2
  • 16
  • 28
5
votes
2 answers

why Light Inject's source code all in one .cs file

like this https://github.com/seesharper/LightInject/blob/master/LightInject/LightInject.cs It's hard to reading, is there any deep meaning?
5
votes
1 answer

LightInject IoC container throws stackoverflow when resolving type

When trying out the LightInject IoC container http://www.lightinject.net/ it throws a stackoverflow exception when resolving the type ISomeService: All types are registered in App_Start: container.RegisterAssembly("MyApp*.dll"); And then when I try…
JK.
  • 21,477
  • 35
  • 135
  • 214
4
votes
1 answer

How to intercept a factory in lightinject

Not sure what to do here. invocationInfo.Proceed() always fails when trying to Intercept a factory that has constructor injection. var container = new ServiceContainer(); container.Register(); container.Register
YurikoEX
  • 105
  • 2
  • 9
3
votes
1 answer

Configure AutoMapper using LightInject

Does anyone know how to configure AutoMapper using LightInject? The AutoMapper documentation only has examples for Ninject and Simple Injector. I am having difficulty trying to register the AutoMapper configuration. I'm using ASP.NET MVC C#. public…
Kevin C.
  • 155
  • 1
  • 8
3
votes
1 answer

LightInject: Constructor Injection and IDisposable

I'd like to use LightInject's constructor injection feature, but I'd like to clear up things first about lifetime management of IDisposables. Consider the following: Example A public class Foo : IDisposable { readonly IBar bar; public…
uzul
  • 1,096
  • 9
  • 23
3
votes
1 answer

LightInject SignalR missing .RegisterHubs method

I just started using LightInject for my MVC project and it's working just fine. But i wanted to use it for my SignalR hubs too. So i followed the instructions at http://www.lightinject.net/#signalr. However i cannot see the method…
3
votes
1 answer

How to pass a parameter to a named services in LightInject?

In LightInject,registering a named service goes a s follows: container.Register(); container.Register("AnotherFoo"); var instance = container.GetInstance("AnotherFoo"); A service with a…
Tomasz Plonka
  • 285
  • 4
  • 12
3
votes
1 answer

Resolve instances in static functions using LightInject

I'm using LightInject in an ASP MVC project. The initialization code is more or less the same as on: http://www.lightinject.net/#mvc My question is how to resolve instances in static functions, for example an HTML helper: public static string…
Marthijn
  • 3,292
  • 2
  • 31
  • 48
3
votes
1 answer

How to override a type already registered in LightInject using a new instance passed to the constructor?

In repository I keep some instances which live throughout the lifetime of my application but sometimes I need an immediate replacement for such instance with another instance and LightInject even if passing the new instance to the…
too
  • 3,009
  • 4
  • 37
  • 51
3
votes
3 answers

LightInject vs (Ninject and Unity) Unregistered Type Resolution

This may be obvious to some, but... Is there a way to resolve non-registered types with LightInject? Also, is it good practice to auto-magically resolve objects with DI frameworks without explicit injections for readability? In my examples, I'm…
antwarpes
  • 2,257
  • 2
  • 17
  • 18
1
2 3 4 5 6 7