ASP.NET MVC 4 + Ninject MVC 3 = No parameterless constructor defined for this object

前端 未结 17 1536
猫巷女王i
猫巷女王i 2020-11-30 01:41

UPDATE - Please look at my answer for a link and explanation of the solution to this problem

Before we start, I know this is a very common quest

17条回答
  •  醉酒成梦
    2020-11-30 02:11

    I was pulling my hair out on this for several hours on a recent project that I moved from MVC 3 to MVC 4. With the lack of on point answers I figured it had to be something I did as it appears that the Ninject.MVC3 nuget package will work fine with MVC 4 - and indeed it does.

    In my case I wasn't fully upgrading the MVC3 project. After following this guide I got things to work as expected. My guess was that I was missing an assembly binding redirect.

    So if you're upgrading an MVC 3 project to MVC 4, using Ninject and getting the no parameterless constructor defined error, hope this helps.

提交回复
热议问题