Xamarin Forms IOS Failed to load System.Net.Http.Primitive assembly

I am trying to build releases for an iOS application using Xamarin.Forms in Visual Studio 2015.

In the iOS Build menu in the application properties, If I installed only the Linker SDK Linker layout or linked all the assemblies, I get the following build error:

Could not resolve the assembly: "System.Net.Http.Primitives, Version = 1.5.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a 'BlackhawkPlatform.App.iOS

If I do not link any of the assemblies, the application builds perfectly, but the ipa output exceeds 40 MB, large 0 uncompressed more than 100 MB and, as such, cannot be sent to iTunes Connect.

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

enter image description here

I tried to skip the build link using the command --linkskip=System.Net.Http.Primitives in the "Advanced mtouch" field, but this does not work.

Any idea how I can get around this, please?

+5
source share
2 answers

Found a solution that worked.

  • In the Nuget Package Manager, install the latest version of Microsoft.BCL.Build v1.0.21
  • then install the latest version of Microsoft.Net.Http v2.2.29

It worked for me.

+10
source

I know this is an old thread ... but here is what I found 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
source

Source: https://habr.com/ru/post/1244845/


All Articles