ServiceStack/ServiceStack — Issue #81: IContainerAdapter is broken
Author: riviti
Created: 2012-01-28 12:27:20+00:00
State: open

The solution to the problems with integrating an external IoC container seems to be to implement IContainerAdaptor. However, this interface is broken since there is no way of managing destruction of the resolved components.

This is a deal-breaker for integrating Windsor for example; you'll end up leaking every instance ever created by Windsor.

To properly support Windsor, a Release(object component) method needs to be added.

For more information, see http://mikehadlow.blogspot.com/2011/02/mvc-30-idependencyresolver-interface-is.html (replace IDependencyResolver with IContainerAdapter in the article) and http://kozmic.pl/2010/08/19/must-windsor-track-my-components/

ServiceStack seems to be really nice, but this prevents me from using it (and maybe some error handling issues, but I haven't looked much at that yet) since we already use Windsor and since we need per-request lifestyle for services. Migrating to Funq is not possible/worth the time.