Register all Controllers programatic in Castle Windsor container from all assemblys
I use this code...

            container.Register(
                AllTypes
                .FromAssembly(Assembly.Load("MyNamespace.Dashboard"))
                .BasedOn<IController>()
                .Configure(component => component.LifeStyle.Transient
                .Named(ControllerNameFromType(component.Implementation)))
                );

... to register my controllers in the container but I would like to be able to register all controllers from all assemblys to get things more pluggable. I thought that the code below should work but it doesent?

            Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();

            foreach (var assembly in assemblies) {
                container.Register(
                    AllTypes
                    .FromAssembly(assembly)
                    .BasedOn<IController>()
                    .Configure(component => component.LifeStyle.Transient
                    .Named(ControllerNameFromType(component.Implementation)))
                    );
            }
Register all Controllers programatic in Castle Windsor container from all assemblys
===

I use this code...

            container.Register(
                AllTypes
                .FromAssembly(Assembly.Load("MyNamespace.Dashboard"))
                .BasedOn<IController>()
                .Configure(component => component.LifeStyle.Transient
                .Named(ControllerNameFromType(component.Implementation)))
                );

... to register my controllers in the container but I would like to be able to register all controllers from all assemblys to get things more pluggable. I thought that the code below should work but it doesent?

            Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();

            foreach (var assembly in assemblies) {
                container.Register(
                    AllTypes
                    .FromAssembly(assembly)
                    .BasedOn<IController>()
                    .Configure(component => component.LifeStyle.Transient
                    .Named(ControllerNameFromType(component.Implementation)))
                    );
            }