【问题标题】:Including Amazon S3 Nuget with Xamarin Android App Results in FileNotFoundException将 Amazon S3 Nuget 与 Xamarin Android 应用程序包含在 FileNotFoundException 中
【发布时间】:2016-11-23 20:09:09
【问题描述】:

当我将 Amazon S3 Nuget 包添加到我的 xamarin android 应用程序时,我收到以下错误,

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  

知道如何解决这个问题吗?

尼克。

更新:刚刚尝试使用 Windows 10 通用应用程序,我明白了,

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   

S3 库是坏了还是什么?

【问题讨论】:

  • 从异常看来,您需要 Http 客户端库。你可以试试这个问题的指导吗? stackoverflow.com/a/19411822/775544
  • 我已经看过那个帖子,不幸的是它没有帮助。我认为 amazon sdk 有问题,因为它甚至无法与通用 Windows 10 应用程序一起使用,添加引用后,我收到大量这些警告..
  • "严重代码描述项目文件行抑制状态警告检测到包降级:Microsoft.NETCore.UniversalWindowsPlatform 从 5.2.2 到 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"
  • 现在我决定从一个 Windows 窗体应用程序和一个标准的 .net 类库开始,当我得到它的工作时,我会将我的代码移植到一个可移植的库中。我怀疑 AWS S3 库可能需要更新?
  • 我发现了 Kvandike 的一个名为 BasicAWS 的小型库,它编译得很好,所以现在可能是一个解决方案。

标签: c# amazon-s3 xamarin.android nuget


【解决方案1】:

有点晚了,但我设法解决了它。

  1. 卸载所有 AWSSDK nuget
  2. 首先添加 Microsoft.Net.Http nuget
  3. 添加 AWSSDK.Core、S3,然后添加 Cognito + 您需要的任何其他内容

【讨论】:

  • 谢谢,直接添加 Microsoft.Net.Http nuget 就可以解决我的问题了!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-02
  • 1970-01-01
  • 1970-01-01
  • 2012-08-13
  • 2016-05-12
相关资源
最近更新 更多