title: Castle Windsor and its own configuration file
body: <p>I am using Castle Windsor for IoC, and have the configuration held in the <code>web.config</code>/<code>app.config</code>, using the following factory:</p>
  
  <pre><code>public static TYPE Factory(string component)
      {
          var windsorContainer = new WindsorContainer(new XmlInterpreter());
          var service = windsorContainer.Resolve&lt;TYPE&gt;(component);
  
          if (service == null)
              throw new ArgumentNullException(string.Format("Unable to find container {0}", component));
  
          return service;
      }
  </code></pre>
  
  <p>and my <code>web.config</code> looking like this:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/&gt;
    &lt;/configSections&gt;
    &lt;castle&gt;
      &lt;components&gt;
        &lt;component id="Data" service="Data.IData, Data" type="Data.DataService, Data"/&gt;
      &lt;/components&gt;
    &lt;/castle&gt;
    &lt;appSettings&gt;.......
  </code></pre>
  
  <p>Which works fine, but I'd like to place the configuration for Castle Windsor in a file called <code>castle.config</code>. How do I do this?</p>