How to add Ninject to your project using Visual Studio 2010 SP1

Posted: August 18, 2011 in IDE, Programming, Visual Studio
Tags: , , , , ,

If you happen to reach this page, chance are you are facing what I just faced several minutes ago. Scratching my head to follow some programming book instruction (read: instruct me to add ninject by ‘Add Library Package Manager’ where I couldn’t find it).

I am not really sure what have changed between the author’s VS2010 and my current version. The fact is, ‘Add Library Package Manager’ somehow is not visible at my IDE. After several minutes of try and error, I manage to install Ninject by doing these steps:

  1. Right click on your project’s Reference in the Solution Explorer.
  2. Select Manage NuGet Packages.
  3. Click Online on the left side of the dialog.
  4. Search Ninject.
  5. Click Install button.
  6. Click on ‘I Accept‘ button.
  7. Done…. 😀

Note 1: Ninject can’t be added directly to Visual Studio in global manner due to its dependency on your project’s .NET version. Therefore, it has to be added on project basis.

Note 2: If your project has some compiling issue or problem, make sure your project use .NET framework version 4.

  • Select project properties mkenu item under the Project Menu
  • Change the Target Framework setting to .NET framework 4

Leave a comment