不带TypeName的Xamarin.Forms项目中的TypeLoadException

时间:2016-05-31 04:38:34

标签: xamarin xamarin.forms microsoft-cognitive

我正在使用Xamarin.Forms进行简单的ProjectOxford Face和Emotion API演示

我将Nuget中的Face和Emotion API添加到PCL Forms项目以及所有特定于平台的项目中我得到了TypeLoadException但TypeName属性为空,所以我不知道什么没有加载。

iOS项目中的“链接行为”设置是“请勿链接”,应用程序在模拟器中运行,选择一张图片,但当它点击应该将其发送到Face和Emotion API的方法时,我得到以下例外。

System.TypeLoadException: Failure has occurred while loading a type.
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00031] in /Library/Frameworks/Xamarin.iOS.framework/Versions/9.9.0.719/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:316
  at HelloForms.FaceViewModel.DoAnalyzePhoto () [0x0000f] in <filename unknown>:0
  at HelloForms.FaceViewModel+<FaceViewModel>c__async8.MoveNext () [0x00021] in .../HelloForms/XPlat/HelloForms/ViewModels/FaceViewModel.cs:115
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/9.9.0.719/src/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/9.9.0.719/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/1381/3afb4af5/source/maccore/src/UIKit/UIKitSynchronizationContext.cs:24
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/1381/3afb4af5/source/maccore/src/Foundation/NSAction.cs:163
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/1381/3afb4af5/source/maccore/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/1381/3afb4af5/source/maccore/src/UIKit/UIApplication.cs:63
  at HelloForms.iOS.Application.Main (System.String[] args) [0x00008] in .../HelloForms/XPlat/iOS/Main.cs:17

0 个答案:

没有答案