[英]Ninject for MVC5, WebApi2 using OWIN
I would like to use Ninject as the IoC container for a current project along with MVC5/WebApi2 pipelined via OWIN on IIS. 我想使用Ninject作为当前项目的IoC容器以及通过IIS上的OWIN流水线化的MVC5 / WebApi2。 However I've got a hard time in getting a clear picture about the numerous Ninject extensions, eg which are the prefered ones for such a setup, which ones are deprecated, which ones are actually required and which ones just provide a class or two that might not be necessary after all.
然而,我很难清楚地了解大量的Ninject扩展,例如哪些是这种设置的首选扩展,哪些被弃用,哪些是实际需要的,哪些只提供一两个类毕竟可能没有必要。
So we got... 所以我们得到......
I'm especially confused because for MVC, I'm used to Ninject.MVC5, which requires Ninject.Web.Common and WebActivatorEx, however when utilizing OWIN, pipelining Ninject using Ninject.Web.Common.OwinHost seems to be the standard approach. 我特别困惑,因为对于MVC,我习惯于Ninject.MVC5,它需要Ninject.Web.Common和WebActivatorEx,但是当使用OWIN时,使用Ninject.Web.Common.OwinHost对Ninject进行流水线操作似乎是标准方法。 Then again, Ninject.Web.Common.OwinHost doesn't seem to be compatible with OWIN v3, whereas Ninject.Web.WebApi.Owin (for WebApi 2) already is.
然后,Ninject.Web.Common.OwinHost似乎与OWIN v3不兼容,而Ninject.Web.WebApi.Owin(对于WebApi 2)已经是。 Additionally, many of the packages are maintained by a dev called Remo Gloor (props to him for a genious MVC3 package!), however the 'official' ones are maintained by "Ninject Project Contributors".
此外,许多软件包都是由一个名为Remo Gloor的开发人员维护的(为他提供了一个传统的MVC3软件包!),但“官方”软件包由“Ninject Project Contributors”维护。
Please, can anyone help me through this extension jungle to get a proper setup? 请问,任何人都可以帮助我通过这个扩展丛林来获得正确的设置吗?
The following 2 links outline the requirements for hosting the WebApi portion in OWIN/IIS and making use of Ninject. 以下2个链接概述了在OWIN / IIS中托管WebApi部分以及使用Ninject的要求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.