Search code examples
asp.net-mvcninject

Error activating HomeController using implicit self-binding of HomeController - NInject Error


I have an ASP.NET MVC 3 application. It runs successfully on my local machine, using IIS Express under Visual Studio 2012 RC.

But It doesn't seem to run on my server/host. I get the following error:

Error activating HomeController using implicit self-binding of HomeController No constructor was available to create an instance of the implementation type.

Activation path:

  1. Request for HomeController

Suggestions:

  1. Ensure that the implementation type has a public constructor.

  2. If you have implemented the Singleton pattern, use a binding with InSingletonScope() instead.

I have searched all over web, couldn't find a solution. It looks its an error because I don't have a constructor defined or have private constructor in my HomeController, but this is not the case.

I have NInject.dll in bin folder..

Can't figure out...


Solution

  • It really was a NInject.dll issue. I was using .NET 4.5 earlier and the web host had .NET 4.5. So I switched my application to .NET 4.0. I later picked up a NInject.dll from an application which was already running and replaced it current application's dll and it worked.