Loading modules in all assemblies in Ninject

后端 未结 4 1075
遥遥无期
遥遥无期 2021-01-31 06:12

I have couple of class libraries in my project and all are using Ninject IoC container. I wanted to load all the modules in a StandardKernel at one go

4条回答
  •  一生所求
    2021-01-31 06:40

    I think that is not a good idea to use CurrentDomain.GetAllAssemblies() because not all project assemblies can be loaded on program startup ( some assemblies can be loaded on user actions for example or other events). In this case you will have null-reference exceptions for dependencies.

提交回复
热议问题