views:

59

answers:

1

I had the following code that was working well before the addition of Areas in MVC 2 :

protected override IWindsorContainer CreateContainer(string windsorConfig)
        {

            IWindsorContainer container = new WindsorContainer();

            container.Register(Component.For<IUnitOfWorkFactory>()
                .ImplementedBy<NHibernateUnitOfWorkFactory>());

                container.Register(AllTypes.Of<IController>()
                     .FromAssembly(typeof(HomeController).Assembly)
                     .Configure(t => t.Named(t.Implementation.Name.ToUpper())
                     .LifeStyle.Is(LifestyleType.Transient)));


            return container;
        }

It doesn't work anymore with MVC 2.0 Areas feature.

Could you guide me through a possible solution

Thanks

A: 

The controllers need to be registered with lowercase names. See this article. I recommend using MvcContrib, it has extension methods to easily register controllers in Windsor, taking care of these details, and also a ControllerFactory implementation.

Mauricio Scheffer
That solved everything... Thank youDo you know a link to MVCContrib Windsor IoC documentation or videos ?
Bernard Larouche