Why is my Castle Windsor controller factory's GetControllerInstance() being called with a null value?

后端 未结 4 805
遥遥无期
遥遥无期 2021-02-04 10:30

I am using Castle Windsor to manage controller instances (among other things). My controller factory looks like this:

public class WindsorControllerFactory : Def         


        
4条回答
  •  一向
    一向 (楼主)
    2021-02-04 11:08

    regarding registration of all the controllers you'd usually do it like this:

    container.Register(
       AllTypes.FromThisAssembly()
          .BasedOn()
          .Configure(c => c.Lifestyle.Transient)
    );
    

    See the documentation for more explanation of the API.

提交回复
热议问题