Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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...

like image 600
Brij Avatar asked Oct 25 '25 02:10

Brij


1 Answers

I had trouble with this same issue with NInject and didn't read the whole message.

MAKE SURE YOUR CONSTRUCTOR IS PUBLIC

mine was protected. Hope that saves someone else time :)

like image 169
Micah Armantrout Avatar answered Oct 26 '25 18:10

Micah Armantrout