title: Castle Windsor resolving a generic interface
body: <p>I have generic interface with some implementations.</p>
  
  <pre><code>interface IBaseInterface&lt;in TObject, out TDetails&gt;
  {
      TDetails GetDetails(TObject obj);
  }
  
  abstract class BaseImpl&lt;TObject&gt; : IBaseInterface&lt;TObject, string&gt;
  {
      public abstract string GetDetails(TObject obj);
  }
  
  class Impl0 : BaseImpl&lt;decimal&gt;
  {
      public override string GetDetails(decimal obj)
      {
          return "decimal";
      }
  }
  
  class Impl1 : BaseImpl&lt;string&gt;
  {
      public override string GetDetails(string obj)
      {
          return "string";
      }
  }
  
  class Impl2 : BaseImpl&lt;Details&gt;
  {
      public override string GetDetails(Details obj)
      {
          return "Details";
      }
  }
  
  class Impl3&lt;TDetail&gt; : BaseImpl&lt;DetailsGeneric&lt;TDetail&gt;&gt; where TDetail : Details
  {
      public override string GetDetails(DetailsGeneric&lt;TDetail&gt; obj)
      {
          return "GenericDetails";
      }
  }
  
  class Details
  {
  
  }
  
  class Details1 : Details
  {
  
  }
  
  class DetailsGeneric&lt;TDetails&gt; : Details
  {
  
  }
  </code></pre>
  
  <p>Using WinsdorInstaller class for register components</p>
  
  <pre><code>container.Register(AllTypes.From(typeof(Program).Assembly.GetTypes())
    .BasedOn(typeof(IBaseInterface&lt;,&gt;)).WithServiceAllInterfaces()
    .LifestyleTransient());
  </code></pre>
  
  <p>Try resolve. Last two calls throwing exceptions, but I expect that they return components declared for base types</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          var container = new WindsorContainer();
  
          container.Install(new WindsorInstaller());
  
          Details("test", container);
  
          Details(123m, container);
  
          Details(new Details(), container);
  
          Details(new DetailsGeneric&lt;Details&gt;(), container);
  
          Details(new Details1(), container); // "ComponentNotFound" exception
  
          Details(new DetailsGeneric&lt;Details1&gt;(), container); // "ComponentNotFound" exception           
      }
  
      static void Details&lt;TType&gt;(TType obj, WindsorContainer container)
      {
          var details = container.Resolve&lt;IBaseInterface&lt;TType, string&gt;&gt;().GetDetails(obj);
  
          Console.WriteLine(details);
      }
  }
  </code></pre>
  
  <p>Where i am wrong? and can I fix it?</p>