Adding Ninject.MVC3 to existing MVC(4) project - asp.net-mvc

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....

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.

Related

The type or namespace name "MyBindingLib" does not exist in the namespace (are you missing an assembly reference?)

I have xamarin.ios binding project for ios library. When I reference it in some xamarin.ios project, it shows lots of errors like:
The type or namespace name "MyBindingLib" does not exist in the namespace (are you missing an assembly reference?)
Is there any possible workaround to get rid of it? (Except using "build only" option in error list window, which is useless for the actual code)
It compiles and works successfully, though.
Any help is appreciated. Thanks in Advance.
This sounds like a bug I filed a while ago:
https://bugzilla.xamarin.com/show_bug.cgi?id=42448
If so, the workaround is to reference the binding project's .dll instead of the binding project itself. IOW, build the binding project and then add a reference to that .dll from your X.iOS project.

How to reference another project from an F# project?

I have two F# projects in a solution. I added a reference of project1 to project2. When I try to use modules from project1 I get
Error The type referenced through 'xxx' is defined in an assembly
that is not referenced. You must add a reference to assembly 'yyy'.
Error tells that reference of a dll which is used by project1 should be added to project2. With C# it works only by adding a reference to the other project. Is there something extra we should do in order to avoid adding those dlls to every project we use references?

Custom membership in mvc entity framework 6

I am using Entity Framework 6 in my project and applying custom membership for the project. Custom membership is located in different project of a same solution. I referenced the main project and the database but i am still getting the error on dbcontext....
The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. E:\Project\ECommerce\ECommerce\Authentication\Authentication.cs 180 13 Authentication
In adition to the main project and database references, you have to add the reference to the Entity Framework Nuget package to the project with the custom membership authentication stuff.

Error compiling C# project with Protractor.dll as reference

We are developing a framework on top of Protractor/Selenium framework. Our projects are all C# signed projects. So, we need to reference signed Protractor and Selenium dlls.
I used the signed WebDriver.dll and Webdriver.Support.dll (version 2.46) from here.
But, when I compile my project, I am getting the below error -
"The type 'OpenQA.Selenium.Internal.IWrapsDriver' is defined in an assembly that is not referenced. You must add a reference to assembly 'WebDriver, Version=2.46.0.0, Culture=neutral, PublicKeyToken=null'."
How can I address this error and get my code running?

MvvmCross Tutorial - Portable Class Library assembly reference error - MonoDroid

I am really eager to get started with MvvmCross - it looks like a very promising framework for cross-platform solutions. Anyway, I am having a build error as I'm going through the tutorial, https://github.com/slodge/MvvmCross/wiki/Tutorial-Part-1. The error arises in building the Android project component. This is the error:
Error 1 The type 'Android.App.Activity' is defined in an assembly that is not referenced. You must add a reference to assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd'. C:\Users\Steven\documents\visual studio 2010\Projects\Tutorial\Tutorial.UI.Droid\Views\MainMenuView.cs
I saw some similar questions posted (Portable Class Library strong assembly reference problems in MonoTouch/MonoDroid) and followed the suggested solutions but without success. This was in VS2012, so I tried it in VS2010 and encountered the same problem. Has anyone come across this error? The PCL portion (Tutorial.Core) builds fine on its own. I checked the PCL csproj file and saw it is using Profile 104 and I did already create the MonoAndroid xml file that sits in that directory:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks\MonoAndroid,Version=v1.6+.xml
The reference for Mono.Android in the Tutorial.UI.Droid project appears to be fine. The path for the dll is C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll and VS reports Resolved=True and Strong Name=True for this reference.
Any help would be greatly appreciated.
Your problem has nothing to do with PCL. Starting version 4.2, Mono for Android assemblies are strong-named i.e. assemblies shipped by Xamarin will be signed with a Xamarin key. Earlier the assemblies were either not signed or only delay-signed. This change affects the strongnames of some Xamarin assemblies.
Like in your case, it is asking you to add reference to:
Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd
which is strong-named. At present you'd be using:
Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
which is not strong-named.
So all you need to do is re-build all your assemblies (in MVVMCross as well as any other projects you may have) that refer Mono.Android with the new strong-named assembly.
That should fix your problem.

Resources