これは私の Application_Start がどのように見えるかです:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
_container.Register(Component.For<IWindsorContainer>()
.Instance(_container),
Component.For<IView, IViewPageActivator>()
.ImplementedBy<RazorView>(),
Component.For<IFilterProvider>()
.ImplementedBy<WindsorFilterAttributeFilterProvider>(),
Component.For<IControllerFactory>()
.ImplementedBy<WindsorControllerFactory>(),
Component.For<ControllerContext>()
.ImplementedBy<ControllerContext>()
);
_container.Register(
AllTypes.Of<IController>()
.FromAssembly(Assembly.GetExecutingAssembly())
.Configure(c => c.LifeStyle.Transient)
);
しかし、ソリューションを実行しようとすると、次のエラーが発生します。
Can't create component 'System.Web.Mvc.RazorView' as it has dependencies to be
satisfied.
System.Web.Mvc.RazorView is waiting for the following dependencies:
Keys (components with specific keys)
- viewPath which was not registered.
- layoutPath which was not registered.
- runViewStartPages which was not registered.
- viewStartFileExtensions which was not registered.
実行時に必要な情報を動的に取得できるようにコンテナーをセットアップするにはどうすればよいですか? 少なくともviewPathはControllerごとに変わると思います。