I had the same problem and fixed it by switching to the NinjectHttpApplication extension, and not to the NinjectWebCommon.cs approach. See https://github.com/ninject/ninject.web.mvc/wiki/Setting-up-an-MVC3-application for more details.
For the Ninject 3 update to work, I had to add the following bindings to my binding modules:
Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel); Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
I think the root of the problem is that NinjectWebCommon.cs starts before the application is fully aware of its own context, so the Entity Framework cannot figure out how to parse connection strings if the context is created as part of a custom binding. This will not be a problem for many projects, but our system uses the database configuration to determine which Ninject modules are loaded first. The global Application_Start method is supposedly called at some later point in the application life cycle, so setting up bindings in Global works just fine.
Stripling warrior
source share