I'm really confused about small, partial, one-file examples where there's a Ninject kernel everywhere without showing how to really get to that kernel in the application.
(1) Should we instantiate one Kernel and keep it in "static" context? Or should we instantiate a different one on every request (*in Application_BeginRequest*)
(2) If it is "kernel per request", then why Initialize() method of the NinjectWebCommon.cs (gets when you install the NuGet package) is called on Application_Start since it calls bootstrapper.Initialize(CreateKernel) - NinjectWebCommon.cs
(3) If it is "one global static kernel" then the "InRequestScope()" doesn't work. It executes the following code and that returns null because at ApplicationStart() time there's no request.
kernel.Components.GetAll<INinjectHttpApplicationPlugin>()
.Select(c => c.RequestScope)
.FirstOrDefault(s => s != null);
(4) Again, if it is "kernel per request", where will we save the kernel? HttpContext.Current? Then what is meaning of using InRequestScope() if I'm going to use HttpContext.Current anyway?
Ninject.MVC3
Package's code spit? What's not working? What ahve you tried? (It's likely to be a different question when you do, so asking a new question might be the best thing to do) – AmbleNinject.MVC3
and use it to store a ref the single kernel after Initialize. You def dont want to get into 2 kernels or 2 sets of registrations or you'll get lots of confusion for lots of reasons – Amble