ASP.NET Core MVC 中是否继续支持 Ninject? [英] Continued Ninject support in ASP.NET Core MVC?

查看:39
本文介绍了ASP.NET Core MVC 中是否继续支持 Ninject?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很高兴使用 Ninject 很长时间了,我真的很喜欢它,但是自从 ASP.NET Core 发布后,我面临着一个艰难的选择code> 和 MVC 核心.

基本上,一出门,微软就公开了自己的依赖注入系统;据我所知,哪一个受到了很多批评.但我更大的问题在于它如何影响其他图书馆.

来自我问的另一个问题网上其他资源,看来Ninject不行带有 MVC Core 的盒子.虽然有一个解决方案"以详细库的形式给出 Microsoft.Framework.DependencyInjection.Ninject 和 Ninject.这甚至更棘手,因为该库需要将 https://www.myget.org/F/aspnetmaster/ 添加到您的 NuGet 提要列表中.

我进行了一些挖掘并找到了托管该库的位置;看起来不错,据我所知,它似乎工作正常,但有一些问题困扰着我.

  • 图书馆似乎并不是真的由 Ninject 创建者领导
  • 该库深埋在一个不起眼的存储库中
  • 网上的实际 Ninject 资源从未提及

所以基本上,我非常担心这是某种创可贴,并且对 Ninject(甚至其他容器库)的支持正在消失.是否有一些我没有发现的隐藏信息?

解决方案

  • 图书馆似乎并不是真的由 Ninject 领导创作者

那个库,它看起来是这些也是Microsoft 创建了依赖注入提供程序的示例,这些示例在 beta7 中删除.请注意MVC 6中的DI 您的原始问题引用如下;

<块引用>

这些 DI 容器适配器是临时的,仅供参考;我们预计它们最终会被移除并被各自的集装箱所有者.

他们应该如此.Microsoft 不应负责维护第 3 方提供商.

<块引用>
  • 该库深埋在一个不起眼的存储库中

如果您不知道,ASP.NET 5 仍在开发中.Beta 7 在 nuget 上作为预发布版本提供,但还有其他来源,包括;

这些来源由 Microsoft 维护.

<块引用>
  • 网上的实际 Ninject 资源从未提及

与任何新开发一样,第 3 方库提供商必须自己确定何时(如果有的话)他们将提供支持新代码库的产品实现.对于某些人来说,等待新框架正式发布是最有效的方式,因为在此之前 API 重大更改仍然很有可能发生.是否会实施支持当然取决于提供者的资源和/或在开源的情况下社区.

I have been very happily using Ninject for a long time now, and I really like it, but I am faced with a difficult choice since the release of ASP.NET Core and MVC Core.

Basically, out of the gate, Microsoft has revealed their own dependency injection system; Which is one that to my knowledge has gotten a lot of criticism. But my bigger problem lies with how it affects other libraries.

From another question I asked and other resources online, it seems that Ninject does not work out of the box with MVC Core. Though there is a "solution" given in the form of a verbose library Microsoft.Framework.DependencyInjection.Ninject and Ninject. This is even trickier because that library requires adding https://www.myget.org/F/aspnetmaster/ to your list of NuGet feeds.

I have done some digging and found where this library is hosted; It looks fine, it seems to work okay from what I can tell, but there are a few things that trouble me.

  • The library does not really appear to be headed by the Ninject creators
  • The library is buried pretty deep in an obscure repository
  • The actual Ninject resources online never mention it

So basically, I am very concerned that this is some kind of band-aide, and that support for Ninject (and even other container libraries) is dying out. Is there some hidden information that I'm just not discovering?

解决方案

  • The library does not really appear to be headed by the Ninject creators

That library, and it would seem these also, look to be Microsoft created samples of Dependency Injection providers that were removed in beta7. Note that the link to DI in MVC 6 referenced by your original question says the following;

These DI container adaptors are temporary and are there for reference; we expect that they will eventually be removed and replaced by the respective container owners.

As they should be. Microsoft should not be responsible for maintaining 3rd party providers.

  • The library is buried pretty deep in an obscure repository

If you are not aware, ASP.NET 5 is still in development. Beta 7 is available on nuget as a pre-release, but there are other sources as well including;

These sources are maintained by Microsoft.

  • The actual Ninject resources online never mention it

As with any new development, 3rd party library providers must themselves determine when (if at all) they will provide implementations of their products that support the new codebase. For some, it will be seen as most efficient to wait until the new framework is officially released, as API breaking changes are still highly likely to occur until that point. Whether support will be implemented at all is of course up to the providers resources, and/or in the case of open source the community.

这篇关于ASP.NET Core MVC 中是否继续支持 Ninject?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆