我試圖讓我的方式通過Android的Xamarin Studio MvvmCross示例。 我已經上傳了我的解決方案版本:https://github.com/Krumelur/MvvmCrossTest綁定在Android的MvvmCross測試應用程序不起作用(TargetInvocationException)
我的環境是XS 4.0.13,X.iOS 7.0.2.7,X.Android 4.8.3。所有獨立版。
我試過了Stuart博客文章的版本,但是我無法構建它,因爲它需要Xamarin Business License,因爲它引用了System.ServiceModel,所以我無法比較它是否可以在那裏工作。
當運行應用程序每次都遇到我輸入一個字符在文本字段時以下情況除外:
[0:] MvxBind:Error:132.38 SetValue failed with exception - TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.Source.Leaf.MvxLeafPropertyInfoSourceBinding.SetValue (System.Object value) [0x00080] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Binding\Bindings\Source\Leaf\MvxLeafPropertyInfoSourceBinding.cs:86
InnerException was TypeLoadException: Could not load type 'System.Linq.Expressions.Expression' from assembly 'AndroidDemo.Core'.
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Bindings.Source.Leaf.MvxLeafPropertyInfoSourceBinding.SetValue (System.Object value) [0x00080] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Binding\Bindings\Source\Leaf\MvxLeafPropertyInfoSourceBinding.cs:86
InnerException was TypeLoadException: Could not load type 'System.Linq.Expressions.Expression' from assembly 'AndroidDemo.Core'.
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
可以使所有這些變化對你的屬性才具有LINQ的異常彈出別的地方 - 內部mvvmcross視圖模型匹配例如。我會等到他們修復它,或者如您所說,在每次安裝mono.droid的新版本後,使用固定的裝飾替換外觀裝配。 – samneric