97 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
87
views
Generic context factory using LightInject in .NET 8 with generics
I am creating a library for our department to access multiple resources. Each resource type is in its own project inside the large solution. Each project will be built into its own NuGet package and ...
0
votes
1
answer
3k
views
.net framework- how to create IServiceProvider to get already registered service instance using IServiceProvider?
On .NET Framework 4.6.2 application, where there is no built-in DI container we are using LightInject DI Container to object initialization but don't know how to create 'IServiceProvider' Object in ...
0
votes
1
answer
271
views
LightInject equivalent lifetime in .netcore DI container
Migrating from 'LightInject' to .netcore DI container.
What are the .netcore DI container equivalents of below LightInject related registrations?
a. container.RegisterConstructorDependency<IBar>...
0
votes
0
answers
235
views
Lightinject - how to safely begin new scope outsice composition root?
I have Windows service accepting some messages. I use LightInject for DI. The service writes into database via dbContext every time any message comes. Thus I need to limit dbContext's lifetime to ...
0
votes
0
answers
130
views
light inject - unit testing
I have an c# interface with multiple implementations & each implementation is taking various dependencies object in its constructor.
In order to achieve DI using LightInjector on web api project, ...
0
votes
0
answers
264
views
How to register an open generic that accepts parameters in LightInject?
I have the following generic class, which depends on IBar:
public class Foo<T> : IFoo<T>
{
public Foo(IBar bar, int value) { }
...
}
I would ideally register it using ...
0
votes
1
answer
679
views
LightInject - Register multiple implementation of same interface
Using Lightinjector DI framework how to register multiple implementation of same interface? how to mention the same interface on constructor and ask for its different implementation?
container....
0
votes
0
answers
63
views
ASP.NET MVC site occasionally rendering in random RESX language - Possible DI Issue?
I have an ASP.NET 4.8 MVC app that has numerous languages. These are RESX files which are defined in their own class library. That class library is then being injected into the MVC app using ...
2
votes
0
answers
169
views
Lightinject optional property injection
I would like consumers of my nuget package to be able to inject an optional IConfiguration implementation. I'm using it along with Umbraco, so it's wired up automatically with Lightinject 5.4.
I've ...
1
vote
0
answers
193
views
.Net Core, LightInject: How to set up DI via properties
Can't set up dependency injection via properties in a class...
I googled everything and looked through all the documentation, so I couldn't find anything how to configure on .net core mvc... Help me ...
1
vote
0
answers
1k
views
.NET Core, DI LightInject: How to inject a dependency in a Static class?
Please help me sort it out.. ;)
How to inject a dependency in a static class?
I want to inject Mapper into a static class.
I read the documentation and google about LightInject and did not find how to ...
0
votes
1
answer
370
views
Dependency injection(Autofac equivalent for resolvebyname or key)
It was very handy with Autofac on dependency injection.
Recently I changed project where lightinject and unitycontainer uses. Here I am able to register a list of services with a name, but I'm unable ...
2
votes
0
answers
300
views
How to use LightInject with Web Forms?
I have a legacy ASP.Net Web Forms application targeting .Net 4.8 in which I would like to use dependency injection. Our engine of choice is LightInject.
With the help of this answer and the source ...
0
votes
1
answer
554
views
Get Hangfire working with ASP.NET MVC and LightInject
I have an ASP.NET MVC App and I recently upgraded to use LightInject DI.
However I cant seem to get Hangfire running correctly, even using the LightInject Extension!
My Hangfire setup in Startup.cs:
...
2
votes
1
answer
670
views
How to inject IServiceContainer when using LighInject?
I am using LightInject and now I need to know how to resolve a type myself. I've tried to use IServiceContainer, but when I inject this interface into my class I get an error saying that is an ...