Ninject for MVC5, WebApi2 using OWIN

I would like to use Ninject as an IoC container for the current project along with MVC5 / WebApi2 piped through OWIN to IIS. However, I am having a hard time getting a clear picture of the numerous Ninject extensions, for example. which are preferred for such an installation, which ones are deprecated, which ones are really needed, and which ones just provide a class or two that may not be needed in the end.

So we got ...

  • Ninject.Web.Common
  • Ninject.Web.Common.OwinHost
  • Ninject.Web.Common.WebHost
  • Ninject.MVC5
  • WebActivatorEx (not part of Ninject, but depends)
  • Ninject.Web.WebApi.OwinHost (Ninject OWIN host for WebApi 2)
  • Ninject.Web.WebApi (Ninject integration for WebApi 2)

I'm especially confused because for MVC I'm used to Ninject.MVC5 which requires Ninject.Web.Common and WebActivatorEx, however, when using OWIN, Ninject pipelining using Ninject.Web.Common.OwinHost seems to be the standard approach. Again, Ninject.Web.Common.OwinHost doesn't seem to be compatible with OWIN v3, whereas Ninject.Web.WebApi.Owin (for WebApi 2) is already there. Also, many of the packages are maintained by a developer called Remo Gloor (props for it for the brilliant MVC3 package!), However the "official" ones are supported by the "Ninject Project Contributors".

Please help me through this jungle extension to get the right setup?

+3


source to share


1 answer


The following 2 links describe the requirements for hosting the WebApi portion in OWIN / IIS and using Ninject.



+2


source







All Articles