title: Autofac Scanning Assemblies for certain class type
body: <p>I've started using <code>Autofac</code> and want to scan some DLL's and get <code>Autofac</code> to register some of the classes within them.</p>
  <p>The classes that I'm interested in all inherit from a PluginBase class but the below code doesn't seem to be registering them.  Can anyone help?</p>
  <pre><code>        var assemblies = AppDomain.CurrentDomain.GetAssemblies();
  
  
          var builder = new ContainerBuilder();
          builder.RegisterAssemblyTypes(assemblies)
              .Where(t =&gt; t.BaseType == typeof(PluginBase))
              .AsImplementedInterfaces()
              .AsSelf();
  
          var container = builder.Build();
          var pluginClasses = container.Resolve&lt;IEnumerable&lt;PluginBase&gt;&gt;();
  
          //pluginClasses is empty!!!!
  </code></pre>