【发布时间】:2017-05-07 05:31:44
【问题描述】:
我有一个针对 .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 包似乎依赖于一组旧的反应包(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?
【问题讨论】:
标签: c# .net nuget reactiveui reactive