且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET Core MVC 中是否继续支持 Ninject?

更新时间:2023-02-25 09:13:56

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

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

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

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

  • 该库深埋在一个不起眼的存储库中

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

这些来源由 Microsoft 维护.

  • 网上的实际 Ninject 资源从未提及

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

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.