BH4NG

Results 14 comments of BH4NG

@remcoros Thank you very much for your answer, I'm very happy with it! Will look into both options and follow what feels good! Thank you again 🥇

I am indeed working in dotnet core. What would be my best move? rollback to 8.0 for now, register the new interfaces or migrate to dotnet 5? If I were...

With my DI package at 9.0 I still get the same error though Output gives me: Exception thrown: 'System.InvalidOperationException' in MediatR.dll An exception of type 'System.InvalidOperationException' occurred in MediatR.dll but...

I don't have a minimal repro atm, it occurs in a rather large project of mine, so I'm still investigating to narrow down atm. ValidationBehaviour.cs public Task Handle(TRequest request, CancellationToken...

I checked my registered services, to see what's what... seems like ISender & IPublisher are missing ImplementationType ![mediatr3](https://user-images.githubusercontent.com/57762378/96288435-b72b6780-0fe3-11eb-9c58-925072e804b2.PNG)

Couldn't make a min repro, but did some more investigating: rolled-back MediatR from 9.0 to 8.1, problem still occured rolled back MediatR DependencyInjection from 9.0 to 7.0, no problem occured...

I kept typeof(IMediator) singleton and changed ISender & IPublisher to transient and indeed things work again. Big thanks for the help gentlemen. I do need to add, if I update...

Sure, before and after upgrade I used: services.AddMediatR(typeof(TStartup).GetTypeInfo().Assembly); services.AddMediatR(cfg => cfg.AsScoped(), typeof(QueryHandler).GetTypeInfo().Assembly); services.AddScoped(); services.AddTransient(typeof(IPipelineBehavior), typeof(ValidationBehavior)); services.AddScoped(); I also added the following, but I don't think it's necessary services.TryAdd(new ServiceDescriptor(typeof(IMediator), new...

services.AddMediatR(cfg => cfg.AsSingleton(), typeof(ILogger).GetTypeInfo().Assembly, typeof(ItemQueryHandler).GetTypeInfo().Assembly); works with DependencyInjection at 7.0 but not with 9.0

Can I register the handlers asScoped() along as registering something asSingleton()? I cannot used two lambdas, no?