I did a bit more research into the Windsor/IDisposable issue this morning, and the default behaviour can be changed by providing the Microkernel with a custom IReleasePolicy. Something like this should do the trick:
public class ControllerReleasePolicy : Castle.MicroKernel.Releasers.LifecycledComponentsReleasePolicy {
public override void Track(object instance, IHandler handler) {
if(! (instance is Controller)) {
base.Track(instance, handler);
}
}
}
Then it can be registered with the container:
var container = new WindsorContainer();
container.Kernel.ReleasePolicy = new ControllerReleasePolicy();
...and now Windsor won't hold a reference to objects that inherit from Controller.
I think if we include a custom ReleasePolicy in mvccontrib, then we can safely use the CSL with Windsor so long as we include a warning in the documentation/samples that the container should be configured to use the custom ReleasePolicy.