5

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 Answers 2

11

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.

Sign up to request clarification or add additional context in comments.

4 Comments

This progressed me to a next error which was 'Failed to create the a fat library. Please review the build log. (MT5306)' I'll see if I can gather more on this.
I don't think it relates, but your answer seems to have got me further. Thanks.
Hi, I have been finding issue where packages were not being unzipped properly. I ended up removing the packages from the packages.config file and deleting them from the folder then re install them. In some cases that worked as well. I think there are still a few issues to resolve around Xamarin deployments though.
My other issue was nothing to do with this problem, so I can confirm your solution was correct. (My other issue was that I hadn't accepted my Xcode terms after an upgrade so it wouldn't deploy). Many hoops to jump through hey? Many thanks @loanburger
1

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>

1 Comment

Yes that's what "should" get added when the Nuget Package is installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.