无法添加面部认知服务Nuget

时间:2018-07-05 11:29:32

标签: xamarin.forms microsoft-cognitive

我正在尝试将Microsoft Cognitive Service Face API集成到我的Xamarin Forms应用中。我已经在PCL中安装了Microsoft.ProjectOxford.Common.DotNetStandard Version="1.0.0"Microsoft.ProjectOxford.Face" Version="1.4.0"。但是每次我尝试编译代码时,都会出现错误

对于iOS,我得到:

xxx.iOS/MTOUCH: Error MT2002: Failed to resolve "Microsoft.ProjectOxford.Face.IFaceServiceClient" reference from "Microsoft.ProjectOxford.Face, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" (MT2002) 

对于Android,我会得到:

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.ProjectOxford.Face, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Perhaps it doesn't exist in the Mono for Android profile?
    File name: 'Microsoft.ProjectOxford.Face.dll'
      at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x0009a] in /Users/builder/data/lanes/5945/dffc5912/source/monodroid/external/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:229 
      at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in /Users/builder/data/lanes/5945/dffc5912/source/monodroid/external/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:179 
      at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver, System.Collections.Generic.ICollection`1[T] assemblies, Mono.Cecil.AssemblyDefinition assembly, System.Boolean topLevel) [0x0014a] in <96027da06dd5411688a31011072e256f>:0 
      at Xamarin.Android.Tasks.ResolveAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAs

semblyResolver resolver) [0x00237] in <96027da06dd5411688a31011072e256f>:0  

Xamarin形式:3.0.0.482510。 有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

我认为这是您的问题所在

  

我已经安装了Microsoft.ProjectOxford.Common。 DotNetStandard   版本=“ 1.0.0”,Microsoft.ProjectOxford.Face“版本=” 1.4.0“    PCL

您试图将.NET Standard库安装到PCL中,但不能保证兼容。您既可以将PCL升级到.NET Standard库(无论如何都很好),或者安装较旧版本的NuGet软件包。