System.Net.Primitives version differences in PCL Profile 7 vs PCL Profile 78 / by Pranav Khandelwal

I recently ran into a strange issue with a version mismatch for the System.Net.Primitives assembly between PCL profile 7 and PCL profile 78. Profile 78 targeted version 3.9 whereas Profile 7 targeted version 4.0.

The primary reference "MyLibrary" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Net.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "4.0.0.0" than the version "3.9.0.0" in the current target framework. (MSB3258) (myApp.Core)

What was even more strange was that the warning above would only be fired on Xamarin Studio running on Windows. XS on Mac would build fine, however, XS on windows would fail to resolve the "MyLibrary" reference due to the mismatch.

The way I solved the issue was by making sure the PCL Profiles matched. Profile 78 does not include System.Net.Http, which was being used in "MyLibrary", so that had to be included in as a Nuget package.

Hope this helps anyone else having version mismatches for various assemblies between PCL profiles. Feel free to reach out if you are having the same issue.

Thanks!
PK