c# - 为什么 ReactiveUI 依赖旧版本的 System.Reactive?

标签 c# .net nuget reactiveui reactive

我有一个针对 .Net 4.5.2 的多项目 Visual Studio 解决方案。在其中一个项目(一个 WPF 应用程序)中,我使用 nuget 添加了 System.Reactive 版本 3.0.1000.0 包,然后添加了 ReactiveUI 7.0.0.0 包。

在另一个 WPF 应用程序使用的类库项目中,我只是添加了 System.Reactive 版本 3.0.1000.0 包。

ReactiveUI 包似乎依赖于一组旧的 react 包(RX-Core2.2.5 等)。我可以这样说,因为 WPF 应用程序项目文件中的 HintPaths 指向诸如 packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll 等位置

当我构建并运行应用程序时,我得到一个 FileLoadException,因为至少有一个项目试图使用错误的 dll 版本。以下是典型的....

System.IO.FileLoadException occurred
  HResult=0x80131040
  Message=Could not load file or assembly 'System.Reactive.Linq, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我可以通过将解决方案中的所有 System.Reactive 包降级到 2.2.5 来解决这个问题,但这似乎是一个非常旧的版本 (2014)。

为什么 ReactiveUI 引入了对 System.Reactive v2.2.5 的依赖?有什么方法可以更改此行为,以便我可以在整个解决方案中使用最新版本的 System.Reactive?

最佳答案

这在 this issue on github 中有解释.长话短说——新版本的 Reactive Extensions 出现在 RxUI 7.0 开发周期的后期,因此团队决定在此版本中跳过它。它可以帮助人们维护现有的应用程序——他们可以升级 RxUI 版本而不会同时影响 Rx 版本。计划在 RxUI 8.0 版本中依赖最新的 Rx。

As @shiftkey states it:

Due to the minor API churn that System.Reactive 3.0 introduced (it was more about the infrastructure and getting things into the foundation), and the fact that RxUI 7.0 was already so close, it was decided that it was easier to leave that out for the next major release.

And yes, with all the infrastructure work now in place we are aiming to keep the RxUI 8 release cycle focused.

边注。事实上,Rx 2.x 已经很长时间(2014 年)没有更新了,这并不像看起来那么糟糕——这是一项非常可靠的技术,您可以放心使用它。升级到 3.0 并没有在 API 方面改变太多(也没有引入重大变化)所以如果你现在坚持使用 2.x,那么在你的项目周期后期升级应该不会很痛苦。

尽管如此,如果你今天真的想使用 Rx 3.0 和 RxUI,我建议你加入 project slack channel并参与该项目,通过测试最前沿的版本并做出自己的贡献:)

关于c# - 为什么 ReactiveUI 依赖旧版本的 System.Reactive?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41268764/

相关文章:

c# - 基于参数抛出/不抛出异常 - 为什么这不是一个好主意?

c# - OPC dll - 如何批量检索标签值

.net - 在 VB.NET 中使用 VB 6.0 窗体

c# - XNA - 获取当前屏幕分辨率

c# - 在 C# 中完成方法指南和最佳实践

c# - 使用带有 Gmail OAuth 的 MailKit 发送邮件

.net - 使用 mono 在命令行上创建 .Net 解决方案

c# - IWizard 带有多项目模板来获取 nuget 预发布包

c# - 无法运行启用迁移 VS2013 SP4

当引用的项目需要时,SQLite.Interop.dll 文件不会复制到项目输出路径