加载Ninject组件ICache时ASP.NET MVC错误 [英] ASP.NET MVC Error loading Ninject component ICache

查看:88
本文介绍了加载Ninject组件ICache时ASP.NET MVC错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了以下错误:

System.InvalidOperationException: Error loading Ninject component ICache
No such component has been registered in the kernel's component container.

使用以下NuGet软件包:

Using the following NuGet packages:

  • 注入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引导程序设置绑定(默认设置).

The Binding are setup using WebActivator and the Ninject Bootstrapper (default setup).

看来此错误曾经是加载Ninject组件ICache时出错.

It appears this error was once an issue before Ninject 2.2.1.0 and Ninject.MVC3 2.2.1.0 were released and this article is similar but I'm not using Web.Api Error loading Ninject component ICache.

可能值得一提的是,我有两个内核.主内核在应用程序启动时创建,并在关闭时处置.我们在启动过程中使用了第二个内核,但是由于不再需要它而几乎立即将其丢弃.那么这可能会引起问题吗?

It might be worth noting that I have two Kernels. The main kernel is created at application start-up and is disposed on shutdown. The second kernel us used during start-up but is disposed almost immediately as it's not needed again. So would this possibly cause the issue?

推荐答案

事实证明,此问题是由于存在两个内核.他们一定是在以某种方式发生冲突,我没有确定原因,而是选择删除了第二个内核.

It turns out the issue was due to the fact that there were two Kernels. They must have been conflicting somehow, I didn't determine the cause and opted to remove the second Kernel.

这篇关于加载Ninject组件ICache时ASP.NET MVC错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆