Wednesday, July 21, 2010

Error while implementing Ninject 2 in an ASP.NET MVC 2 Application - No parameterless constructor defined for this object.

Ninject is a very cool open source Inversion of Control container and also has been promoted by some of the best in the industry. However, when I tried to implement Ninject V2 in my ASP.NET MVC 2 web application, I ran into the following error and spent a couple of frustrated hours going through blogs after blogs to make sure I’m implementing it right.
Ninject2Error
So here’s the solution -
Pull the source code for Ninject.MVC.Web from  from git hub and re-compile it with MVC2 installed on your machine. Yup, that's all that is needed.
An even simpler fix -  download the demo solution (Ninject_v2_Mvc) from here and use the Ninject.dll and Ninject.Web.MVC in the Dependencies folder of the solution.
This post is -Works On My Machine

No comments:

Post a Comment