5
votes

I'm trying to do a release build for an IOS app using Xamarin.Forms in Visual Studio 2015.

Under the iOS Build menu in the properties of the app, If I set the Linker behaviour Link SDK assemblies only or Link all assemblies - I get the following build error:

Failed to resolve assembly: 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' BlackhawkPlatform.App.iOS

If I don't link any of the assemblies - the App builds fine but the output ipa is over 40mb big 0 uncompressed over 100mb and as such cannot be submitted to iTunes Connect.

I have the latest version installed of System.Net Client libraries and Xamarin Forms.

enter image description here

I have tried to skip the assembly link by using the command --linkskip=System.Net.Http.Primitives in the Additional mtouch argument box but that dos not work.

Any idea how I can get around this please?

2

2 Answers

11
votes

Found a solution which worked.

  1. In Nuget package manager install the latest version of Microsoft.BCL.Build v1.0.21
  2. then install the latest version of Microsoft.Net.Http v2.2.29

This worked for me.

1
votes

I know this is an old thread... but here is what I found missing in my ios.csproj file

<Reference Include="System.Net.Http.Extensions">
  <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\Xamarin.iOS10\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
  <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\Xamarin.iOS10\System.Net.Http.Primitives.dll</HintPath>
</Reference>