I am trying to search for a set of components that implement a specific base class in assemblies in the same directory as my application. I need to do this as a kind of plugin architecture, since my application uses these types to populate other components.
Ninject.Extensions.Conventions supports checking assemblies in a local directory, so I decided to take a snapshot.
The problem is that the binding generators that the library provides ( DefaultBindingGenerator and RegexBindingGenerator ) will only bind components to the interfaces that they implement. They will not bind to base types without an interface.
How to use this library to bind by agreement to the base class, and not to the interface?
I am using the version currently on NuGet - 2.2.0.5
My current conditional expression-based binding code is as follows:
Kernel.Scan(x => { x.FromAssembliesMatching("*.dll"); x.WhereTypeInheritsFrom<BaseType>();
When I try to resolve components, nothing is returned:
var myTypes = Kernel.GetAll<BaseType>(); int count = myTypes.Count();
source share