Reputation: 756
I was trying to make our app mvvm compliant. Currently all the code is written in the code behind. I decided to use SimpleIOC and MVVM Light. But for some reason is just doesn't want to work. I'm running on profile 111. I've registered my classes and interfaces. And when I try to resolve them, this is the exception I get this exception. Any pointers?
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Practices.ServiceLocation.ActivationException: Type not found in cache: CustomerApp.Service.RestClient.IApiClient. at GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService (System.Type serviceType, System.String key, System.Boolean cache) [0x0003f] in D:\GalaSoft\mydotnet\MVVMLight\source\GalaSoft.MvvmLight\GalaSoft.MvvmLight.Extras (PCL)\Ioc\SimpleIoc.cs:537 at GalaSoft.MvvmLight.Ioc.SimpleIoc.GetService (System.Type serviceType) [0x00000] in D:\GalaSoft\mydotnet\MVVMLight\source\GalaSoft.MvvmLight\GalaSoft.MvvmLight.Extras (PCL)\Ioc\SimpleIoc.cs:789 at GalaSoft.MvvmLight.Ioc.SimpleIoc.MakeInstance[TClass] () [0x00064] in 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 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00050] in /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] in /Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00107] in /Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/Delegate.cs:461 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x0000b] in /Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/MulticastDelegate.cs:67 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/Delegate.cs:406 at GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService (System.Type serviceType, System.String key, System.Boolean cache) [0x000c9] in D:\GalaSoft\mydotnet\MVVMLight\source\GalaSoft.MvvmLight\GalaSoft.MvvmLight.Extras (PCL)\Ioc\SimpleIoc.cs:567 at GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance[TService] () [0x00000] in D:\GalaSoft\mydotnet\MVVMLight\source\GalaSoft.MvvmLight\GalaSoft.MvvmLight.Extras (PCL)\Ioc\SimpleIoc.cs:912 at CustomerApp.App..ctor () [0x00016] in C:\Xamarin Backup\CustomerApp\CustomerApp\CustomerApp\App.xaml.cs:29
Upvotes: 0
Views: 1277
Reputation: 756
I changed my profile to 259 and added Microsoft http client nuget. That seemed to do the trick
Upvotes: 1