我试图让我们的应用程序符合mvvm。目前所有的代码都写在后面的代码中。我决定使用SimpleIOC和MVVM Light。但出于某种原因,他们并不想工作。我在个人资料111上运行。我已经注册了我的课程和界面。当我尝试解决它们时,这是我得到此异常的例外。有什么指针吗?
System.Reflection.TargetInvocationException:调用目标抛出了异常。 ---> Microsoft.Practices.ServiceLocation.ActivationException:在缓存中找不到类型:CustomerApp.Service.RestClient.IApiClient。 在D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoft.MvvmLight.Extras中的GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService(System.Type serviceType,System.String key,System.Boolean cache)[0x0003f] (PCL)\ Ioc的\ SimpleIoc.cs:537 在D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoft.MvvmLight.Extras(PCL)\ Ioc \ SimpleIoc.cs中的GalaSoft.MvvmLight.Ioc.SimpleIoc.GetService(System.Type serviceType)[0x00000]: 789 在GalaSoft.MvvmLight.Ioc.SimpleIoc.MakeInstance [TClass]()[0x00064]在D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoft.MvvmLight.Extras(PCL)\ Ioc \ SimpleIoc.cs:729 at(wrapper managed-to-native)System.Reflection.MonoMethod:InternalInvoke(System.Reflection.MonoMethod,object,object [],System.Exception&) at System.Reflection.MonoMethod.Invoke(System.Object obj,System.Reflection.BindingFlags invokeAttr,System.Reflection.Binder binder,System.Object [] parameters,System.Globalization.CultureInfo culture)[0x00038] in / Users / builder /data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 ---内部异常堆栈跟踪结束--- 在System.Reflection.MonoMethod.Invoke(System.Object obj,System.Reflection.BindingFlags invokeAttr,System.Reflection.Binder binder,System.Object [] parameters,System.Globalization.CultureInfo culture)[0x00050] / Users / builder中/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:313 at System.Reflection.MethodBase.Invoke(System.Object obj,System.Object [] parameters)[0x00000]在/ Users / builder / data / lanes / 3819 / c1d1c79c / source / mono / mcs / class / referencesource / mscorlib /系统/反射/ methodbase.cs:229 在System.Delegate.DynamicInvokeImpl(System.Object [] args)[0x00107] /Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/Delegate.cs:461 在/Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/MulticastDelegate.cs:67中的System.MulticastDelegate.DynamicInvokeImpl(System.Object [] args)[0x0000b] 在/Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/Delegate.cs:406中的System.Delegate.DynamicInvoke(System.Object [] args)[0x00000] 在D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoft.MvvmLight.Extras中的GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService(System.Type serviceType,System.String key,System.Boolean cache)[0x000c9] (PCL)\ Ioc的\ SimpleIoc.cs:567 在GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance [TService]()[0x00000]在D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoft.MvvmLight.Extras(PCL)\ Ioc \ SimpleIoc.cs:912 位于C:\ Xamarin Backup \ CustomerApp \ CustomerApp \ CustomerApp \ App.xaml.cs中的CustomerApp.App..ctor()[0x00016]:29
答案 0 :(得分:1)
我将个人资料更改为259并添加了Microsoft http客户端nuget。这似乎可以解决问题