Ninject.MVC3 Bootstrapper's Kernel property is marked as Obsolete. How can I get access to the kernel?
问题 I updated Ninject.MVC3 package from 2.2.1.0 to 2.2.2.0. Before I had access to the Kernel object through BootStrapper.Kernel property but in the new version Kernel property is marked as obsolete. I get a warning saying 'Public ReadOnly Property Kernel As Ninject.IKernel' is obsolete: 'Do not use Ninject as Service Locator'. Is there a different way to access the kernel in the new version? 回答1: The reason why this has been marked Obsolete and will be changed to internal in future is that