In the NinjectWebCommon.cs
I have this:
private static IKernel CreateKernel()
{
var kernel = new StandardKernel();
try
{
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
RegisterServices(kernel);
return kernel;
}
catch
{
kernel.Dispose();
throw;
}
}
When I run my ASP.NET MVC app it crashes on that method saying:
An exception of type 'System.IO.FileLoadException' occurred in Ninject.dll but was not handled in user code
Additional information: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have deleted my Ninject DLLs from the References and added them again from the NuGet manager and now my packages file looks like this, but still getting that error:
<package id="Ninject" version="3.2.2.0" targetFramework="net451" />
<package id="Ninject.MVC3" version="3.2.1.0" targetFramework="net451" />
<package id="Ninject.Web.Common" version="3.2.3.0" targetFramework="net451" />
<package id="Ninject.Web.Common.WebHost" version="3.2.3.0" targetFramework="net451" />
What else should I do?