4

When I add the Amazon S3 Nuget package to my xamarin android app, I get the following error,

Severity    Code    Description Project File    Line    Suppression State
Error       Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.Net.Http.Primitives.dll'
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
   at Xamarin.Android.Tasks.ResolveAssemblies.Execute() ContentUpdater  

Any idea how to resolve this?

Nick.

Update: Just tried the same with a Windows 10 Universal App and I get this,

Severity    Code    Description Project File    Line    Suppression State
Error       Cannot resolve Assembly or Windows Metadata file 'System.Net.Http.Primitives.dll'   WindowsContentUpdater   C:\devoctomy\GitHub\ContentUpdater\WindowsContentUpdater\WindowsContentUpdater.csproj   

Is the S3 library broken or something?

Nick
  • 1,015
  • 12
  • 31
  • From exception, seems like you need Http Client library. Can you try guidance on this question? http://stackoverflow.com/a/19411822/775544 – Anthony Neace Nov 23 '16 at 20:47
  • I already looked at that thread and it didn't help unfortunately. I think there is something wrong with the amazon sdk as it won't even work with a universal windows 10 app, after adding the references, I get loads of these warnings.. – Nick Nov 23 '16 at 20:54
  • "Severity Code Description Project File Line Suppression State Warning Detected package downgrade: Microsoft.NETCore.UniversalWindowsPlatform from 5.2.2 to 5.1.0 WindowsContentUpdaterObjectLibrary (>= 1.0.0) -> AWSSDK.S3 (>= 3.3.3) -> Microsoft.NETCore.UniversalWindowsPlatform (>= 5.2.2) WindowsContentUpdaterObjectLibrary (>= 1.0.0) -> Microsoft.NETCore.UniversalWindowsPlatform (>= 5.1.0) 0" – Nick Nov 23 '16 at 20:54
  • For now I've decided to start with a Windows Forms app and a standard .net class library, I will port my code to a portable library when I've got that working. I'm suspecting the AWS S3 library needs updating perhaps? – Nick Nov 24 '16 at 07:58
  • I've found a small library by Kvandike called BasicAWS, that compiles great so may be a solution for now. – Nick Nov 24 '16 at 08:43
  • getting the same issue, I'm guessing you didn't have anymore luck with this? – santaaimonce Mar 19 '17 at 05:37

1 Answers1

2

A little late but I managed to fix it.

  1. Uninstall all AWSSDK nugets
  2. start by adding the Microsoft.Net.Http nuget
  3. Add AWSSDK.Core, S3 and then Cognito + whatever else you need
santaaimonce
  • 134
  • 2
  • 16
  • Thanks, adding the Microsoft.Net.Http nuget directly was sufficient for my problem! – bnu Mar 13 '18 at 15:04