question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No registration for type IEnumerable<IPipelineBehavior<CreateOrganization, Identity>> could be found.

See original GitHub issue

Did container configuration change with the new version? I’m receiving the following error from SimpleInjector.

No registration for type IEnumerable<IPipelineBehavior<CreateOrganization, Identity>> could be found.

with stack trace:

   at SimpleInjector.Container.ThrowMissingInstanceProducerException(Type serviceType)
   at SimpleInjector.Container.GetInstanceForRootType(Type serviceType)
   at SimpleInjector.Container.GetInstance(Type serviceType)
   at SimpleInjector.Container.GetAllInstances(Type serviceType)
   at MediatR.Internal.RequestHandlerImpl`2.GetPipeline(TRequest request, RequestHandlerDelegate`1 invokeHandler, MultiInstanceFactory factory)
   at MediatR.Internal.RequestHandlerImpl`2.Handle(IRequest`1 request, CancellationToken cancellationToken, SingleInstanceFactory singleFactory, MultiInstanceFactory multiFactory)
   at MediatR.Mediator.Send[TResponse](IRequest`1 request, CancellationToken cancellationToken)

My container configuration looks like:

this.container.Register<IMediator, Mediator>(Lifestyle.Scoped);
this.container.Register(typeof(ICancellableAsyncRequestHandler<,>), assemblies, Lifestyle.Scoped);
this.container.Register(() => new SingleInstanceFactory(this.container.GetInstance), Lifestyle.Scoped);
this.container.Register(() => new MultiInstanceFactory(this.container.GetAllInstances), Lifestyle.Scoped);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
Rookiancommented, Apr 24, 2017

This is how I did it so far:

container.RegisterCollection(typeof(IPipelineBehavior<,>), Enumerable.Empty<Type>());
container.RegisterCollection(typeof(IRequestPreProcessor<>), Enumerable.Empty<Type>());
container.RegisterCollection(typeof(IRequestPostProcessor<,>), Enumerable.Empty<Type>());

The option container.Options.ResolveUnregisteredCollections = true; is obsolete. So you really need to register those dependencies explicitly.

1reaction
rnarayanacommented, Aug 6, 2018

In the newer versions of MediatR, @Rookian 's code becomes:

container.Collection.Register(typeof(IPipelineBehavior<,>), Enumerable.Empty<Type>());
container.Collection.Register(typeof(IRequestPreProcessor<>), Enumerable.Empty<Type>());
container.Collection.Register(typeof(IRequestPostProcessor<,>), Enumerable.Empty<Type>());
Read more comments on GitHub >

github_iconTop Results From Across the Web

No registration for type ICommandHandler using ...
I get: No registration for type ICommandHandler<CreateUser> could be found. There is, however, a registration for IEnumerable<ICommandHandler< ...
Read more >
Release release/1.2.3 - AElf's official documentation!
This part will introduce contract deployment pipeline for different chain type on AElf mainnet/testnet/customnet net-.
Read more >
Release release/1.2.3 - AElf's official documentation!
Deploying/Updating Contracts(No BP Approval Required) . ... You can find in the tutorials the scenarios where each type is applicable.
Read more >
Unity QA - LTS Releases
These updates will only cover fixes aimed at improving the stability of the product to enable users to ship their projects. Unity 2021.3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found