Error loading Ninject component ICache

后端 未结 1 1867
小蘑菇
小蘑菇 2021-01-17 22:14

I am using ninject in an asp.net web api project and have started receiving this intermittent ninject error:

\"Error loading Ninject component ICache No such

相关标签:
1条回答
  • 2021-01-17 22:26

    Found the solution and thought I would share.

    The problem was that I was Using Ninject.MVC3 which seems to be wrong package for Web-API.

    Instead I need to use Ninject.Web.WebApi-RC package as described by this post:

    http://www.eyecatch.no/blog/2012/06/using-ninject-with-webapi-rc/

    Steps I followed for a fix are

    • Uninstalled Ninject.MVC3 and Ninject.Web.Common
    • delete all of the ninject files from the App_Start folder.
    • install Ninject.Web.Common and Ninject.Web.WebApi-RC from nuget
    • Load my modules in NinjectWebCommon.RegisterServices()
    0 讨论(0)
提交回复
热议问题