1

I am trying to set up my ASP.NET Web Forms (Framework 4.0) application to use Ninject.Web. I would like to use RC3 of Ninject 3.0.0, since I ran into issues with databound controls.

Through my inspections of Ninject.Web.Common and Ninject.Web, it seems that there are two ways to create a kernel using the existing framework. The first way is through the class defined in the App_Start folder, and the second is through overriding the CreateKernel method when deriving from NinjectHttpApplication.

Going forward with Ninject.Web 3.0.0, which method is preferred for creating a kernel?

John Bledsoe
  • 17,142
  • 5
  • 42
  • 59

1 Answers1

4

There is no prefered way. The App_Start way was added for NuGet, so that it doesn't need to change an existing file. NinjectHttpApplication was kept for backwards compatibility. Use which ever you like more.

Remo Gloor
  • 32,665
  • 4
  • 68
  • 98
  • I suppose the point though is that the two methods are mutually exclusive. I should use one or the other but not both, correct? – John Bledsoe Mar 12 '12 at 16:58