Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:49:06+00:00 2026-06-15T12:49:06+00:00

I recently added both Ninject and Ninject.Web.Mvc to an existing ASP.NET MVC 4 web

  • 0

I recently added both Ninject and Ninject.Web.Mvc to an existing ASP.NET MVC 4 web application. When browsing the site, I receive the following exception, seemingly at random:

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

Suggestions: 1) If you have created a custom subclass for
KernelBase, ensure that you have properly
implemented the AddComponents() method. 2) Ensure that you have not removed the component from the container via a call to
RemoveAll(). 3) Ensure you have not accidentally created more than
one kernel. ] Ninject.Components.ComponentContainer.Get(Type
component) in
c:\Projects\Ninject\ninject\src\Ninject\Components\ComponentContainer.cs:160
Ninject.Components.ComponentContainer.Get() in
c:\Projects\Ninject\ninject\src\Ninject\Components\ComponentContainer.cs:116
Ninject.Web.Common.<>c__DisplayClass2.b__1(IKernel kernel) in
c:\Projects\Ninject\Ninject.Web.Common\src\Ninject.Web.Common\OnePerRequestHttpModule.cs:74
Ninject.GlobalKernelRegistration.MapKernels(Action`1 action) in
c:\Projects\Ninject\ninject\src\Ninject\GlobalKernelRegistration.cs:75
Ninject.Web.Common.OnePerRequestHttpModule.DeactivateInstancesForCurrentHttpRequest()
in
c:\Projects\Ninject\Ninject.Web.Common\src\Ninject.Web.Common\OnePerRequestHttpModule.cs:74
Ninject.Web.Common.OnePerRequestHttpModule.b__0(Object o,
EventArgs e) in
c:\Projects\Ninject\Ninject.Web.Common\src\Ninject.Web.Common\OnePerRequestHttpModule.cs:56
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Once I recieve the exception above, simply refreshing or clicking back seems to cause the site to begin functioning normally again. No one area of the site seems to cause it to occur any more than another.

The issue is quite similar to the question asked here: Ninject + “Error loading Ninject component ICache”. However, the issue in that question seems to be caused by a bug with the extension itself, is over a year old, and looks to have been resolved.

This occurs without any modification to the NinjectWebCommon.cs file, whatsoever. (No modules loaded, no bindings added.) The only way for me to get it to stop is to exclude NinjectWebCommon.cs from the project, altogether.

I’m not sure what other information to include, as I’ve done little other than install the Nuget packages. Perhaps worth noting is that this project does include references to other assemblies that utilize Ninject for DI.

I’ve looked around quite a bit and am at a loss for why this would occur. Any suggestions would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:49:07+00:00Added an answer on June 15, 2026 at 12:49 pm

    Obviously there are multiple Kernels involved in your application (MVC + Libs). Creating and disposing kernel instances during runtime of the application is something that should be avoided. I strongly suggest to change your design so that as few kernels are created at application start. And none is created later (including all libs).

    Having said that, I don’t see any way in the code how this problem can happen with the latest version of Ninject. It may be worth verifying that the Application and ALL the libraries are on the latest version of Ninject.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently added Autofac 2.6.2 to one of my ASP.NET MVC projet. I'm facing
We recently added a new TeamCity build agent. Because it doesn't have ASP.NET MVC
I recently added some url re-writing to my web application and had to added
I am using ASP.NET MVC to develop a site. The CSS file has grown
I've recently added both the JWPlayer and the GAPro addon to my site. The
since today i get an Exception on IIS7.5 with ASP.NET MVC, but i dont
I recently added a feature to a large application written in Delphi (version 2009)
I am relatively new to ASP.NET programming, and web programming in general. We have
I recently added some HTTP caching headers to some of my web service's responses,
I've an application written in VC++ MFC 6.0. Recently got upgraded to .NET 3.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.