I want to use Ninject in a project that integrates ASP.Net and ASP.Net MVC web forms. I use Ninject 2, but when I use NinjectHttpApplication from Ninject.Web.Mvc, it complains when I use things like PageBase that the kernel is not created.
I have the following in Global.asax and I'm not sure what to add.
public class MvcApplication : Ninject.Web.Mvc.NinjectHttpApplication { protected override void OnApplicationStarted() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); RegisterAllControllersIn(Assembly.GetExecutingAssembly()); } protected override Ninject.IKernel CreateKernel() { return new StandardKernel(new ServiceModule()); } }
Does anyone have this working somewhere who could share some thoughts or code with him?
Rody van sambeek
source share