5

I have an older Xamarin forms project that I've updated, that uses Microsoft Azure's Mobile App Services (previously used Azure Mobile Services).

Was working fine, but after a clean and rebuild I now get this error whenever attempting to run it (I'm using Xamarin Studio)

Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Microsoft.Azure.Mobile.Client and SQLiteStore are at version 2.0.1. I've tried removing and readding the assembly via NuGet, without any luck.

Has anyone seen this issue or resolved it?

2
  • Did you see stackoverflow.com/questions/35926640/… ? Commented Jun 22, 2016 at 23:29
  • I did - however both Microsoft.BCL.Build 1.0.21 and Microsoft.Net.Http 2.2.29 are already in the project, and I still have an error that Error CS0012 The type 'HttpMessageHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Commented Jun 26, 2016 at 4:07

3 Answers 3

2

Xamarin iOS (monotouch) depends on System.Net.Http.Primitives version 4.2.29.0, while version 1.5.0.0 is for platform portable-net40+sl4+win8+wp71+wpa81. As Eric Hedstrom commented, have you tried the steps from this answer?

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

2 Comments

I had, but was still getting errors. However I believe I found a workaround below.
Update - looks like the workaround does not. I've added both Microsoft.Bcl.Build 1.0.21 and Microsoft.Net.Http, however still get an error that The type System.Net.Http.HttpClientHandler' is defined in an assembly that is not referenced. Consider adding a reference to assembly System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' (CS0012) Checking to see if it's a conflict with ModernHttpHandler.
0

Solution here wound up being recreating the Xamarin projects, and relinking the portable class library of the old project to it.

Comments

0

I faced a similar error in my solution with Xamarin.iOS native project which is using ModernHttpHandler.

Try adding a reference to standard Mono System.Net.Http in csproj file:

<Reference Include="System.Net.Http" />

For more details take a look at this blog post.

Comments

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.