Adding Ninject.MVC3 to existing MVC(4) project

I am working on a project with MVC4, and have decided that I wish to add some dependency injection via Ninject. After download/install via NuGet, I find this error in the NinjectWebCommon.cs (Line 23):

The type 'System.Web.IHttpModule' is defined in an assembly 
that is not referenced. You must add a reference to assembly 
'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

and then a bit later (line 44):

The type or namespace name 'IHttpModule' could not be found 
(are you missing a using directive or an assembly reference?)

I expect that this Normally works, but that I've done something that doesn't work when adding Ninject to the project after the fact.

Edit: The above errors are only thrown by the test project....

Answers


Make sure you specify the System.Web reference in both the main and test project. The test projects have their own list of references to maintain. I expect you don't have System.Web in the test project.


Make sure Ninject didn't add web references to your model project.


Need Your Help

Mongodb get results asynchronously

javascript node.js mongodb asynchronous express

Here is my action which will get all users from users collection

Migrating from AS2 to AS3

actionscript-3 flash actionscript-2

I would like to know from someone who have already done that, any recommendations and things I have to take a special look, I have seen some articles related to the topic, googled it, etc...