I am trying to use ninject version 3 in asp.net webforms application based on Jason answer
How can I implement Ninject or DI on asp.net Web Forms?
but it is not working?
public class Global : NinjectHttpApplication
{
........
protected override IKernel CreateKernel()
{
IKernel kernel = new StandardKernel(new NinjectWebCommon());
return kernel;
}
}
public class NinjectWebCommon : NinjectModule
{
public override void Load()
{
Bind<IProductRepository>().To<EFProductRepository>();
}
}
When I start debugging the CreateKernel never called and I get an exception NullReferenceException in the page that means no injection happened.