title: Castle.MicroKernel.ComponentNotFoundException with TypedFactoryFacility
body: <p>I am having some problem resolving ITcpServer when using TypedFactoryFacility. It seems that Windsor does not find a suitable component to be returned from factory for the interface. What is specific to my case is that the interface ITcpServer is non-generic while classes implementing it are both generic.</p>
  
  <p>The following code throws when run:</p>
  
  <blockquote>
    <p>Unhandled Exception: Castle.MicroKernel.ComponentNotFoundException: No
    component for supporting the service
    ConsoleApplication1.StandardTcpServer`1 was found    at
    Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type
    service, IDictionary arguments, IReleasePolicy policy)    at
    Castle.Facilities.TypedFactory.TypedFactoryComponentResolver.Resolve(IKernelInternal
    kernel, IReleasePolicy scope)    at
    Castle.Facilities.TypedFactory.Internal.TypedFactoryInterceptor.Resolve(IInvocation
    invocation)    at
    Castle.Facilities.TypedFactory.Internal.TypedFactoryInterceptor.Intercept(IInvocation
    invocation)    at Castle.DynamicProxy.AbstractInvocation.Proceed()<br>
    at Castle.Proxies.ITcpServerFactoryProxy.Create[T](String serverType,
    T something)</p>
  </blockquote>
  
  <p>The code:</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          IWindsorContainer container = new WindsorContainer();
          container.Install(new MyWindsorInstaller());
  
          var f = container.Resolve&lt;ITcpServerFactory&gt;();
          var tcpServer = f.Create("standard", "something");
          tcpServer.Start();
      }
  }
  
   public class MyWindsorInstaller : IWindsorInstaller
  {
      public void Install(IWindsorContainer container, IConfigurationStore store)
      {
          container.AddFacility&lt;TypedFactoryFacility&gt;();
          container.Register(
              Component.For&lt;ITcpServer&gt;().ImplementedBy(typeof(LibUvTcpServer&lt;&gt;)),
              Component.For&lt;ITcpServer&gt;().ImplementedBy(typeof(StandardTcpServer&lt;&gt;)),
              Component.For&lt;ITcpServerFactory&gt;().AsFactory(c =&gt; c.SelectedWith(new TcpServerComponentSelector()))
              );
      }
  }
  
  public class TcpServerComponentSelector : DefaultTypedFactoryComponentSelector
  {
      protected override Type GetComponentType(System.Reflection.MethodInfo method, object[] arguments)
      {
          var serverType = (string)arguments.First();
          return serverType == "standard" ? typeof (StandardTcpServer&lt;&gt;) : typeof(LibUvTcpServer&lt;&gt;);
      }
  }
  
  public interface ITcpServerFactory
  {
      ITcpServer Create&lt;T&gt;(string serverType, T something);
  }
  
  public class StandardTcpServer&lt;T&gt; : ITcpServer
  {
      public void Start()
      {
          Console.WriteLine("Started...");
      }
  }
  
  public class LibUvTcpServer&lt;T&gt; : ITcpServer
  {
      private readonly T something;
  
      public LibUvTcpServer(T something)
      {
          this.something = something;
      }
  
      public void Start()
      {
          Console.WriteLine("Started...");
      }
  }
  
  public interface ITcpServer
  {
      void Start();
  }
  </code></pre>
  
  <p>Any help in solving the problem would be appreciated.</p>