Parameterless constructor error with Ninject bindings in .NET Web Api 2.1

后端 未结 2 515
借酒劲吻你
借酒劲吻你 2020-12-03 10:30

Working currently on writing an API site (.NET Web Api 2.1)

For our prior API sites we had used the Ninject.MVC3 package and wired up a dependency resolver and scope

相关标签:
2条回答
  • 2020-12-03 10:53

    You have to install one of the hosting packages:

    • Ninject.Web.WebApi.WebHost
    • Ninject.Web.WebApi.SelfHost
    • Ninject.Web.WebApi.OwinHost
    0 讨论(0)
  • 2020-12-03 10:56

    Also, double check that your constructor is Public. This is easy to overlook.

    0 讨论(0)
提交回复
热议问题