No matching bindings are available, and the type is not self-bindable in Ninject

前端 未结 2 979
渐次进展
渐次进展 2021-02-20 13:58

I am using Ninjec, Ninject.Web.MVC and Ninject.Web.Common

When I start my mvc application I get this binding error:

What do I wrong in my binding?

2条回答
  •  忘了有多久
    2021-02-20 14:15

    I used to have similar problem. I was using Ninject MVC and I tried to instantiate the kernel using the new StandardKernel ctor, and it did't work.

    My problem was the point 3 that @Elisa mentioned earlier: Ensure you have not accidentally created more than one kernel.

    I solved it by using bootstrapper.Kernel instead.

提交回复
热议问题