1

I am struggling to find out whats wrong with MVC 5 (Visual Studio 2015) Ninject dependency injection. In MVC 4 (Visual Studio 2013), it was quite straight forward to add Ninject with Nuget Package Manager(UI) but don't seems like the case with MVC 5 (VS 2015).

After some unsuccessful attempts, I rather used Package Manager Console and got Nuget and Nuget.Web.Common both packages installed.To my surprise, I can't find my NinjectWebCommon.cs file in App_Start folder now.

I am wondering if MVC 5 has changed the concept of dependency injection or I am doing something wrong here?

Learning Curve
  • 1,449
  • 7
  • 30
  • 60

1 Answers1

1

You need to install the Ninject.MVC5 package. This will add (amongst other things) the NinjectWebCommon.cs file in App_Start.

Owen Pauling
  • 11,349
  • 20
  • 53
  • 64
  • 1
    thanks. I have figured that out already but still mark your answer. Hate so many changes with each and every new version. Wondering though, why Nuget Package Manager still not showing Ninject. At least intellisense should have given me the something. Still nothing in Nuget Package Manger but I have got it installed through the Console. – Learning Curve Aug 11 '17 at 15:53