Unity Application Block 项目进展如何?

What is going on with the Unity Application Block project?

多年来,我一直在一个相当大的项目中使用 Unity 容器进行依赖注入和拦截。自 2012 年以来,我们一直停留在 2.1 版本的库中,该版本运行良好。我认为有必要了解一下 Unity 最近的动态。

我一头雾水回来了。目前,original Unity homepage states that the project has been sourced to the community and moved to a Github repository。我没意见。但是后来我问了一个最基本的问题:what/where是库的最新版本吗?我找到了三个不同的答案:

  1. Github 回购 lists three 3.5 releases,所有这些都是候选版本(也不是真正可用的)。没有以前的版本。
  2. NuGet Gallery 托管了某个 4.0.1 stable version 库,现在官方 Github 项目页面中甚至没有提及。
  3. 已弃用的 Unity Code Plex 主页宣传 3.5 版本,而 downloads page 将版本 3 列为最新版本。

文档更加零散。官方 GitHub 项目有 none 个,而 NuGet 包指向旧的 CodePlex 站点。结果证明这是查找文档和样本的唯一可靠(大概)的地方。

坦率地说,它闻起来有鱼腥味。有人知道发生了什么事吗?我们应该离开 Unity 了吗?谢谢

更新2017-01-31

似乎在大约一年半没有提交之后,Unity 仍然存在并发布了版本 5.x。不幸的是,目前仍然没有来自新维护者的新版本文档,只有微软的旧文档。

原答案

第一个 link 在 original Unity homepage has your answer:

The .NET community has a rich history of dependency injection containers, dating back before the introduction of Unity. Dependency injection containers for .NET have continued to mature and evolve significantly. In addition, open source components are now more accepted. The need for having an “official” container from Microsoft is no longer as widespread as it once was. We did spend a few months in 2014 thoughtfully experimenting for a “Unity 4”. However, we began to recognize that the p&p team was not equipped to carry the project forward.

At the same time, we believe that it would have been a poor choice to simply call the project “done”. We wanted to support all those who had invested in the library. After consulting with internal teams and p&p alumni, we asked Pablo and Pedro to assume the mantle.

(强调)

因为 Unity 的功能集和易于开发在这一点上早已被 Autofac, Simple Injector, and StructureMap, IMO using Unity "just because that is what the examples on MSDN do" is not a good enough reason to stick with it. Unity is not even the container of choice in the brand new ASP.NET core, so its future is looking uncertain 等其他领先者所超越。