Search code examples
castle-windsorthrowresolve

Castle Windsor ResolveAll that throws when any of registered services cannot be resolved


It seems that current behaviour of Castle Windsor (2.0) method


container.ResolveAll(Type type)

is to ignore all services that cannot be resolved due to missing dependencies. What is recommened way to resolve all services + throwing exception when any of services cannot be resolved?


Solution

  • AFAIK there is no built-in way to do that and I've been thinking about implementing an option to throw instead of ignoring invalid components. However, this has some consequences that need to be thought through.

    In the meantime, here's a hack. Let me know if it works for you.