title: Dependency Injection from Multiple Assemblies using Structuremap
body: <p>I am new to DI concept and new to structuremap. I am trying to full fill a scenario where all my interfaces are in <code>AssemblyA</code> and all my implementations are in <code>AssemblyB</code>. I want to use Structuremap to inject instance of <code>AssemblyB</code> class in constructor which has dependency on interface from <code>AssemblyA</code></p>
  
  <pre><code>public class Customer(ICustomerService)
  {
  
  }
  </code></pre>
  
  <p><code>ICustomerService</code> is in <code>AssemblyA</code> and <code>CustomerService</code> class is in <code>assemblyB</code>. I want Structuremap to inject <code>CustomerService</code> instance in this constructor. I am assuming that if the name of class is same as the name of interface prefixed with and <code>I</code>. Structuremap will recognize it automatically.</p>
  
  <p>I have written the following configuration.</p>
  
  <pre><code> x =&gt;
          {
  
  
              x.Scan(scan =&gt;
                  {
                      scan.Assembly("AssemblyA");
                      scan.Assembly("AssemblyB");
                      scan.TheCallingAssembly();
                      scan.WithDefaultConventions();
              });
  </code></pre>
  
  <p>but it gives me error </p>
  
  <pre><code>StructureMap Exception Code:  202
  No Default Instance defined for PluginFamily AssemblyA.ICustomerService, AssemblyA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
  </code></pre>
  
  <p>I want to use the default conventions and avoid registering each interface to a class.</p>