I\'ve started using Autofac and want to scan some DLL\'s and get Autofac to register some of the classes within them.
The classes that I\'m interested in all inherit
Maybe do is this way:
builder
.RegisterAssemblyTypes(AppDomain.CurrentDomain.GetAssemblies())
.Where(t => t.GetInterfaces()
.Any(i => i.IsAssignableFrom(typeof (IDependency))))
.AsImplementedInterfaces()
.InstancePerDependency();
In this code I use IDependency as a marker interface. You may replace it with your PluginBase class and remove Where method.
The point is to use IsAssignableFrom method.