我怎样才能干净利落地解决 System.* 程序集在 PCL 和 UWP App 之间的冲突

How can I cleanly resolve conflicts for System.* assemblies between PCLs and UWP App

我的 Visual Studio 2015(更新 3)使用 Windows SDK 10586 编译的解决方案包含一些 PCL 以及一些 UWP 应用程序。

PCL => LagoVista.Common.Blinds                  references System.Runtime, Version=4.0.0.0
PCL => LagoVista.Common                         references System.Runtime, Version=4.0.0.0
PCL => LagoVista.Common.ISY                     references System.Runtime, Version=4.0.0.0
UWP => LagoVista.Common.UI                      references System.Runtime, Version=4.0.20.0
UWP => LagoVista.Common.UWP                     references System.Runtime, Version=4.0.20.0

在上述情况下,PCL 引用 运行 时间的 4.0.0.0 版本,而 UWP 引用 运行 时间的 4.0.20.0。

这只是我在 PCL 和 UWP 应用程序之间遇到的版本冲突的一小部分。我可以将建议的绑定重定向添加到配置文件中,但我希望程序集至少引用 .NET Framework 程序集的相同版本。这可能吗?

我的解决方案最终改变了我支持的 PCL 平台。本来我是支持WindowsPhone8.0和Windows8.0的。一旦我删除了这些 PCL 依赖项,我就能够删除所有 BCL nuget 包、Microsoft Http 客户端和一些其他未使用的包。这大大简化了我的解决方案并消除了版本冲突。