title: How to Inject Dependencies to Dynamically Loaded Assemblies
body: <p>I have a manager class that loads various plug-in modules contained in separate assemblies through reflection. This modules are communication to the outside world (WebAPI, various other web protocols).</p>
  
  <pre><code>public class Manager
  {
     public ILogger Logger; // Modules need to access this.
  
     private void LoadAssemblies()
     {
       // Load assemblies through reflection.
     }
  }
  </code></pre>
  
  <p>These plug-in modules must communicate with an object contained within the manager class. How can I implement this? I thought about using dependency injection/IoC container, but how can I do this across assemblies?</p>
  
  <p>Another thought that I had, that I am not thrilled with, is to have the modules reference a static class containing the resource that they need.</p>
  
  <p>I appreciate any constructive comments/suggestions.</p>