Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
72 views

I have a .net framework 4.8 project. In my solution, there are a lot of projects. Some of these projects use the SimpleInjector library. Recently I have updated all the packages to the latest version (...
mnu-nasir's user avatar
  • 1,772
0 votes
0 answers
96 views

I'm trying to migrate some code from Simple Injector's RegisterDecorator pattern which is in .Net Framework to .NET Core's IServiceCollection. In Simple Injector, my code looks like this: container....
Ranjith Kumar's user avatar
1 vote
3 answers
128 views

The situation that I have is the following and albeit quite simple, it seems not to be supported (at least out of the box) for 2 DI frameworks that I tried. public interface IPlugin { // misc } ...
Stelios Adamantidis's user avatar
0 votes
1 answer
57 views

I try register collection of implementations but everytime I get error message "-[Lifestyle Mismatch] ReportFileWriter (Singleton) depends on IFileWriter[] (Transient)." I dont know what ...
Pimpy's user avatar
  • 51
0 votes
0 answers
61 views

I have a lot of objects in my program that are created at runtime with at least 1 parameter. There are many nested classes where a new data is evaluated, which is necessary for next inner instances. ...
HedgehogNSK's user avatar
2 votes
1 answer
58 views

I'm developing a Telegram bot. And I'm struggling with SimpleInjector class registration. I need to register a class ProxyBotMesssageSender as a proxy for BotMesssageSender class that implements 3 ...
HedgehogNSK's user avatar
0 votes
0 answers
35 views

In a project I am using CQRSlite and Simple Injector. My first try to register the event handlers: container.Register(typeof(ICancellableEventHandler<>), typeof(...
bdongus's user avatar
  • 688
0 votes
0 answers
143 views

I have a problem with SimpleInjector and I don't know how to resolve it. I'm getting the following error: The configuration is invalid. Creating the instance for type IMiddleware failed. The ...
Iñaki P. B.'s user avatar
0 votes
1 answer
142 views

I am using Simple Injector 5.3.3 and I would like to access at run time to a list of the types inheriting from a generic interface (say IHandleMessage<T>) that I registered in the container. How ...
Hdecagny's user avatar
0 votes
1 answer
90 views

Is it possible to set a timeout on Simple Injector when creating an instance? For example, I had a problem in the past when I instantiated an HTTPClient and the base URL was collected by a query in ...
Diego Faria's user avatar
1 vote
1 answer
331 views

Within a Blazor server application I do use the Simple Injector integration as well as the MediatR. The Simple Injector looks like it works pretty fine together with Blazor with respect to the scoping,...
Jan Drozen's user avatar
  • 1,004
0 votes
1 answer
209 views

All of this is on .NET 6, AutoMapper v12, SimpleInjector v5.4.1 Upon trying to map to IModel (interface of Model), code throws the following stack trace: AutoMapper.AutoMapperMappingException: Error ...
Neven Marić's user avatar
0 votes
1 answer
166 views

I'm using Simple Injector with Owin Selfhosted, but I'm having a problem on calling container.Verify(). When I call container.Verify(), it is creating an instance of all my controllers, but in some of ...
Matheus Hoske's user avatar
1 vote
2 answers
140 views

Our application is similar to an IDE. The user can open files (coming from a DB), and then use the application's various aspects to edit that file. The application can have multiple tabs with ...
Lennart's user avatar
  • 10.3k
0 votes
1 answer
173 views

According to the documentation of Simple Injector one can use the following code to load assemblies dynamically string pluginDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "...
James0n's user avatar
  • 47
0 votes
1 answer
68 views

I noticed a strange behavior when using Simple Injector with ASP.NET Web APIs, so I reduced it to its basics. Steps to reproduce: create ASP.NET Core's default Web API project. I used .NET Core 3.1, ...
Drew's user avatar
  • 339
0 votes
1 answer
159 views

I have the following basic SI registration in an ASP.NET WebApi project. Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services....
Drew's user avatar
  • 339
0 votes
1 answer
230 views

I want to do some integration testing using Simple Injector. However, sometimes I need to check whether a specific internal service has been called with the correct arguments. I am already using ...
Marc Wittke's user avatar
  • 3,174
0 votes
2 answers
98 views

I am trying to use SimpleInjector in a WPF Application (.NET Framework). We use it in exactly the same way in many of our Services but for some reason when I am attempting to implement the same logic ...
Andrew Humphries's user avatar
2 votes
1 answer
807 views

There is a Console Application. There are 3 services: public class SingletonService { public SingletonService() { Console.WriteLine("SingletonService constructor"); } } ...
Evgenii Borisov's user avatar
0 votes
1 answer
392 views

In our .NET 6 apis we are using Simple Injector for dependency injection. With the latest version of Simple Injector, we observed that Snyk found five high-priority vulnerabilities and two medium ...
Thomas Limburg's user avatar
2 votes
2 answers
213 views

In an ASP.NET Web API project, if you are using Simple Injector for dependency injection, it will register all controllers with this line of code: container.RegisterWebApiControllers( System.Web....
CodingYoshi's user avatar
  • 27.3k
0 votes
1 answer
173 views

public class Factor1(int FactorX, int FactorY) : IFactors; public class Factor2(int FactorX, int FactorY, int FZ) : IFactors; public interface IFactors { int FactorX { get; set; } int FactorY ...
lowdegeneration's user avatar
1 vote
1 answer
274 views

Consider the following services.AddSingleton<IActionContextAccessor, ActionContextAccessor>(); services.AddSingleton<IAuthorizationHandler, AccountHandler>(); ... services.AddSingleton<...
Rippo's user avatar
  • 22.5k
2 votes
1 answer
884 views

I've been looking through the Simple Injector documentation and thought I was doing things right regarding Crosswiring, but alas... I have the following which fails to resolve my App through the ...
Stephen York's user avatar
  • 1,499
0 votes
1 answer
615 views

I am working on a .NET core MVC web app. I have a domain object method that perform some business logic and return a result object containing variables passed to view models. The result object has ...
anndexi99's user avatar
  • 199
0 votes
1 answer
758 views

I'm using Mapster for mapping and Simple Injector in my .net framework 4.8 MVC and WebApi controllers. I'd like to inject Mapster as a dependency in my services but I can't figure it out how to make ...
Roy R's user avatar
  • 41
0 votes
0 answers
115 views

having a fresh setup of asp.net core 5 app gives me the problem of not beeing able to set a per web request scope as SimpleInjector tells me to setup a scoped default lifestyle which is in an old ...
nhaberl's user avatar
  • 427
0 votes
0 answers
255 views

I'm trying to send a reset password email, but I keep receiving the error No IUserTokenProvider is registered on the line string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id); I ...
Andrew's user avatar
  • 2,013
0 votes
1 answer
508 views

In Azure Functions (v3 on NetCore3.1) using SimpleInjector 5.3, I've followed the guidance here using IHttpClientFactory instead of a typed client that depends on a MS DI-constructed HttpClient, but ...
pseabury's user avatar
  • 1,765
0 votes
0 answers
79 views

I am trying to register conditionally (based on implementation type) a custom ApiClient using SimpleInjector as can be seen in the following function. private static void RegisterEndpoint<...
doorman's user avatar
  • 17.1k
0 votes
0 answers
82 views

Hello i am working with an asp.net webapi program. i am trying to use simple injector. i can init and register types in application start . but I have a question: how to get container instance to ...
10120's user avatar
  • 135
1 vote
1 answer
529 views

I would like to conditionally register types to a collection based on who the Consumer is. Something like: Container.Collection.RegisterConditionally( typeof(IEventHandler<>), ...
Filip's user avatar
  • 469
0 votes
1 answer
1k views

i'm trying to follow this example here the only thing is i need to inject multiple hosted services instead of one like this services.AddSimpleInjector(container, options => { // Registers the ...
Redouane's user avatar
0 votes
0 answers
193 views

i'm trying to test my controllers with IClassFixture<WebApplicationFactory<Startup>>, but when i run multiples tests i get the error: System.InvalidOperationException : The container can'...
R0ZS3C's user avatar
  • 36
1 vote
1 answer
452 views

I have an object whose constructor requires a primitive. I register it using a delegate (please excuse the contrived example). container.Register<Account>(() => new Account(1000M), Lifestyle....
TKF's user avatar
  • 728
1 vote
1 answer
299 views

Consider the scenario where a service's constructor has a mix of parameters: some you want the container to resolve based on whatever you registered, and some you want the consumer of the service to ...
gusmally supports Monica's user avatar
1 vote
1 answer
201 views

The issue is as follows: I have to access 2 different S3 buckets and the way I have to create AmazonS3clients is as follows: var client = new AmazonS3Client(accesKey,secretKey, bucketRegion); Since I ...
DavidS's user avatar
  • 2,283
1 vote
1 answer
577 views

We currently use SimpleInjector as our DI container to implement the command-query-separation (CQS) pattern by using ICommand and IQuery<TResult> and ICommandHandler<TCommand> and ...
M.E.'s user avatar
  • 2,929
0 votes
0 answers
71 views

I have the following repository which is a generic with two-parameter public interface IClownRepository { } public interface IClownRepository< TEntity> : IClownRepository<...
advapi's user avatar
  • 3,967
2 votes
1 answer
252 views

I want to reuse same class more than once in a chain of decorated objects like this. InstrumentedTargetDecorator -> ResilientTargetDecorator -> InstrumetedTargetDecorator -> Target Note that ...
ambidexterous's user avatar
1 vote
1 answer
229 views

I am able to register a MassTranst SagaStateMachine in a SimpleInjector container using the InMemoryRepository: container.AddMassTransit(cfg => { // Unrelated registration code ommitted // ....
ASP.Tom's user avatar
  • 31
3 votes
0 answers
1k views

I'm trying to create a console application that run ahosted service with Simple Injector and I looked to the example at generichostintegration. Now I would like to change IProcessor.DoSomeWork to be ...
Paolo's user avatar
  • 31
0 votes
0 answers
259 views

There is a legacy class in a huge Winforms solution which I cannot change the constructor (because there are lots of references to it). However, I need to call a new class method within one of the ...
Chinthaka's user avatar
  • 988
0 votes
1 answer
237 views

We have a couple of functions in a function app based on a consumption plan. When I stress test these functions with JMeter (200 threads simultaneously), the functions are throwing SimpleInjector....
Cees's user avatar
  • 324
1 vote
1 answer
849 views

I have to create a small app that uses windows forms. I want to use Simple Injector as IoC Container. Documentation of Simple Injector wrote: It is not possible to use Constructor Injection in User ...
Minh Giang's user avatar
1 vote
1 answer
2k views

Per https://github.com/App-vNext/Polly/wiki/Polly-and-HttpClientFactory#extending-the-convenience-addtransienthttperrorpolicy-definition I can see policies are added with a name. var httpClientOptions ...
morleyc's user avatar
  • 2,501
0 votes
1 answer
1k views

The documentation on the Mapster Wiki isnt very good and I cant seem to get it hooked up with Simple Injector. I have this below: container.RegisterSingleton(() => MapperProvider....
Mike Flynn's user avatar
  • 23.4k
0 votes
1 answer
490 views

I am following this setup below in the AutoMapper setup article but I keep getting this error. Is the documentation incorrect? private static IMapper GetMapper(Container container) { var mp = ...
Mike Flynn's user avatar
  • 23.4k
1 vote
1 answer
1k views

I'm building a .NET Core console app that uses Simple Injector and SimpleRabbit to pubish messages to RabbitMQ. I've run into a run time exception when I attempt to get an registered instance from a ...
JohnB's user avatar
  • 4,479

1
2 3 4 5
23