title: Castle Windsor: Auto-register types from one assembly that implement interfaces from another
body: <p>I use <a href="http://www.castleproject.org/container/" rel="noreferrer">Castle Windsor</a> as my <a href="http://martinfowler.com/articles/injection.html" rel="noreferrer">IoC container</a>.  I have an application that has a structure similar to the following:</p>
  
  <ul>
  <li>MyApp.Services.dll
  
  <ul>
  <li><code>IEmployeeService</code></li>
  <li><code>IContractHoursService</code></li>
  <li><code>...</code></li>
  </ul></li>
  <li>MyApp.ServicesImpl.dll
  
  <ul>
  <li><code>EmployeeService : MyApp.Services.IEmployeeService</code></li>
  <li><code>ContractHoursService : MyApp.Services.IContractHoursService</code></li>
  <li><code>...</code></li>
  </ul></li>
  </ul>
  
  <p>I use the <a href="http://www.castleproject.org/container/documentation/v21/usersguide/externalconfig.html" rel="noreferrer">XML configuration</a> at the moment, and every time I add a new IService/Service pair, I have to add a new component to the XML configuration file.  I want to switch all this over to the <a href="http://using.castleproject.org/display/IoC/Fluent+Registration+API" rel="noreferrer">fluent registration API</a> but haven't worked out <em>exactly</em> the right recipe to do what I want yet.</p>
  
  <p>Can anyone help?  The lifestyles will all be <code>singleton</code>.</p>
  
  <p>Many thanks in advance.</p>