【发布时间】:2014-04-22 03:09:59
【问题描述】:
我收到以下错误:
System.InvalidOperationException: Error loading Ninject component ICache
No such component has been registered in the kernel's component container.
使用以下 NuGet 包:
- Ninject 3.0.1.10
- Ninject.MVC3 3.0.0.6
- Ninject.Web.Common 3.0.0.7
- ASP.NET MVC 4.0.30506.0
使用 WebActivator 和 Ninject Bootstrapper 设置绑定(默认设置)。
看来这个错误在Ninject 2.2.1.0 and Ninject.MVC3 2.2.1.0 were released 之前曾经是一个问题,这篇文章很相似,但我没有使用 Web.Api Error loading Ninject component ICache.
值得注意的是,我有两个内核。主内核在应用程序启动时创建,并在关闭时处理。我们在启动期间使用的第二个内核,但几乎立即被释放,因为不再需要它。那么这可能会导致问题吗?
【问题讨论】:
-
你在使用WebApi吗?可能与此有关:stackoverflow.com/questions/14757142/…
标签: ninject.web.mvc