How to avoid cyclic behaviour with Castle Windsor's CollectionResolver? <p>I am using Castle Windsor 2.5 in my application. I have a service which is a composite that acts as a distributor for objects that implement the same interface.</p> <pre><code>public interface IService { void DoStuff(string someArg); } public class ConcreteService1 : IService { public void DoStuff(string someArg) { } } public class ConcreteService2 : IService { public void DoStuff(string someArg) { } } public class CompositeService : List&lt;IService&gt;, IService { private readonly IService[] decoratedServices; CompositeService(params IService[] decoratedServices) { this.decoratedServices = decoratedServices; } public void DoStuff(string someArg) { foreach (var service in decoratedServices) { service.DoStuff(someArg); } } } </code></pre> <p>The problem I have is that using config such as that shown below causes Windsor to report that "A cycle was detected when trying to resolve a dependency."</p> <pre><code>windsor.Register( Component .For&lt;IService&gt;() .ImplementedBy&lt;CompositeService&gt;(), Component .For&lt;IService&gt;() .ImplementedBy&lt;ConcreteService1&gt;(), Component .For&lt;IService&gt;() .ImplementedBy&lt;ConcreteService2&gt;() ); </code></pre> <p>This cyclic behaviour seems to be at odds with the standard (non-collection based) behaviour that can be used to implenent the decorator pattern, where the component being resolved is ignored and the next registered component that implements the same interface is used instead.</p> <p>So what I'd like to know is whether or not there is a way to make Windsor exclude the <code>CompositeService</code> component when it's resolving the <code>IService</code> services for the <code>decoratedServices</code> property. The <code>decoratedServices</code> property should contain two items: an instance of <code>ConcreteService1</code>, and an instance of <code>ConcreteService2</code>. I'd like to do this without explicitly specifying the dependencies.</p>