MVC 4,DI容器(Windsor)找不到区域内的控制器

时间:2012-07-11 01:38:30

标签: asp.net-mvc-3 asp.net-mvc-4

所以我决定尝试一下区域。使用MVC 4,我设置了一个名为Admin的区域。我使用Windsor作为我的DI容器,我的安装程序看起来像这样。

container.Register(
            AllTypes.FromThisAssembly().BasedOn<IController>().Configure(
                component =>
                    {
                        component.Named(component.Implementation.Name);
                        component.LifestyleTransient();
                    }).WithServiceBase());

我在安装程序中尝试了几次代码,并获得了相同的结果。在监视窗口中,我看到主应用程序的所有控制器,但不是该区域的控制器,该区域位于同一个程序集中,但具有不同的命名空间。我认为FromThisAssembly可以做到这一点,但不是!..

0 个答案:

没有答案
相关问题