title: Castle Windsor resolve zero or more implementations
body: <p>(Slightly simplified scenario to highlight the specific issue).</p>
  
  <p>I'm trying to use Castle Windsor to resolve a component, which has a constructor with a single parameter which is an array of a service interface:</p>
  
  <pre><code>public class TestClass&lt;T&gt;
  {
      public TestClass(IService&lt;T&gt;[] services)
      {
          ...
      }
  }
  </code></pre>
  
  <p>The Windsor container is configured to use the ArrayResolver:</p>
  
  <pre><code>container.Kernel.Resolver.AddSubResolver(new ArrayResolver(container.Kernel));
  </code></pre>
  
  <p>This all works fine, and one or more services are injected for various instances of T.</p>
  
  <p>However, for some T, there are no implementations of <code>IService&lt;T&gt;</code>. The goal would be for the constructor to be called with a zero-length array.</p>
  
  <p>The issue is, if there are no concrete implementations of IService for a given T, how do I register the definition of IService with no implementation, so the container is aware of the type?</p>
  
  <p>I'm current using:</p>
  
  <pre><code>container.Register(
      Classes.FromAssembly(Assembly.GetExecutingAssembly())
          .BasedOn&lt;IService&lt;&gt;&gt;()
          .WithService.FirstInterface());
  </code></pre>
  
  <p>but since this is driven from the concrete classes, it's obviously not registering any 'unused' IService.</p>
  
  <p>Fallback is to provide a stub implementation of IService for any T which doesn't have a 'real' implementation, but I'd prefer not to pollute the code with many such stubs. (Could also provide through an open generic with some reflection...).</p>