Search code examples
.netassemblies.net-assemblyprinter-control-language

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


My Visual Studio 2015 (Update 3) solutions compiled with Windows SDK 10586 consists of some PCLs as well as some UWP apps.

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

In the case above the PCLs are referencing Version 4.0.0.0 of the run time whereas the UWP's are referencing 4.0.20.0 of the run time.

This is only a small sampling of version conflicts I get between my PCL and UWP apps. I could add the suggested binding redirects into the configuration file, but I'd prefer to have the assemblies reference the same version of at a minimum the .NET Framework Assemblies. Is this possible?


Solution

  • My solution ended up being changing the PCL platforms I supported. Originally I had supported Windows Phone 8.0 and Windows 8.0. Once I removed these PCL dependencies I was able to remove all the BCL nuget packages, Microsoft Http Client and some other unused packages. This greatly simplified my solution and eliminated the version conflicts.