title: Find out which module registered type
body: <p>I'm debugging autofac issues in an application with quite a lot of modules. Is there a way to find out what module registered some registration? I'm looking at the <code>ComponentRegistry</code> of the container, but I can't find any information there.</p>
  
  <p><strong>EDIT:</strong>
  A clarification. I have a lot of modules in my solution:</p>
  
  <pre><code>public class MyModule : Autofac.Module {
      public override void Load(ContainerBuilder builder) {
          builder.RegisterType&lt;MyConcreteType&gt;().As&lt;IMyInterface&gt;();
      }
  }
  </code></pre>
  
  <p>I then register in my container by scanning my assemblies:</p>
  
  <pre><code>var builder = new ContainerBuilder();
  builder.RegisterAssemblyModules(/* Get all assemblies in base dir */);
  var container = builder.Build();
  </code></pre>
  
  <p>Now, I have a lot of registrations. My question is "What <code>Module</code> registered <code>MyConcreteType</code>?". I would like to do something like <code>container.ComponentRegistry.Registrations.Select(reg =&gt; new { reg.Service, reg.RegisteredBy })</code>, where <code>RegisteredBy</code> is some magic property.</p>