0

私は、アプリケーションmvvmに準拠させようとしていました。現在、すべてのコードはコードの後ろに書かれています。 SimpleIOCとMVVM Lightを使用することに決めました。しかし何らかの理由で、仕事をしたくないだけです。私はプロフィール111で走っています。クラスとインターフェースを登録しました。そして、私がそれらを解決しようとすると、これは例外です。すべてのポインタ?XamarinフォームでIOCを動作させることができません

System.Reflection.TargetInvocationException:例外が呼び出しのターゲットによってスローされました。 ---> Microsoft.Practices.ServiceLocation.ActivationException:タイプがキャッシュに見つかりません:CustomerApp.Service.RestClient.IApiClient。 GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService(System.Type serviceType、System.String key、System.Boolean cache)D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoft.MvvmLightの[0x0003f]。 Extra(PCL)\ Ioc \ SimpleIoc.cs:537 GalaSoft.MvvmLight.Ioc.SimpleIoc.GetService(System.Type serviceType)[0x00000] D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoftにあります。 D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ GalaSoft内のGalaSoft.MvvmLight.Ioc.SimpleIoc.MakeInstance [TClass]()[0x00064]でのMvvmLight.Extras(PCL)\ Ioc \ SimpleIoc.cs:789 System.Reflection.MonoMethod:InternalInvoke(System.Reflection.MonoMethod、object、object []、System.Exception &).MvvmLight.Extras(PCL)\ Ioc \ SimpleIoc.cs:729 (ラッパーによって管理されるネイティブ) at System.Reflection.MonoMethod.Invoke(System.Ob/Users/builder/data/lanes/3819/c1d1c79c/source /内のSystem.Reflection.BindingFlagsのinvokeAttr、System.Reflection.Binderバインダー、System.Object []パラメーター、System.Globalization.CultureInfoカルチャ)[0x00038]内部例外スタックトレースの末尾--- at System.Reflection.MonoMethod.Invoke(System.Object obj、System.Reflection.BindingFlags)/Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib /にある[0x00050]は、/Users/builder/data/lanes/3819/c1d1c79c/source /内のSystem.Reflection/MonoMethod.cs:313 のSystem.Reflection.MethodBase.Invoke(System.Object obj、System.Object []パラメータ)[0x00000]モノ/ mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229 atシステム.Delegate.DynamicInvokeImpl(System.Object [] args)/Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/Delegate.cs:461 (システムでの[0x00107])。 MulticastDelegate.DynamicInvokeImpl(System.Object [] args)/Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/MulticastDelegate.cs:67 at System.Delegateにある[0x0000b] .DynamicInvoke(System.Object [] args)/Users/builder/data/lanes/3819/c1d1c79c/source/mono/mcs/class/corlib/System/Delegate.cs:406 の[0x00000]はGalaSoft.MvvmLightです。 IOC.SimpleIoc.DoGetService(System.Type serviceType、System.String key、System.Boolean cache)D:¥GalaSoft¥mydotnet¥MVVMLight¥source¥GalaSoft.MvvmLight¥GalaSoft.MvvmLight.Extras(PCL)¥Iocの[0x000c9] \ SimpleIoc.cs:567 GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance [TService]()[0x00000] D:\ GalaSoft \ mydotnet \ MVVMLight \ source \ GalaSoft.MvvmLight \ Gal C:\ Xamarin Backup \ CustomerApp \ CustomerApp \ CustomerApp \ App.xaml.csのCustomerApp.App..ctor()[0x00016]のaSoft.MvvmLight.Extras(PCL)\ Ioc \ SimpleIoc.cs:912 :29

+2

スタックトレースだけではそれほど役に立ちません – Jason

+0

IoCコンテナはどこに登録していますか? – valdetero

+0

私はSimpleIOCがそう簡単ではなかったと思います。 – Will

答えて

1

プロファイルを259に変更し、Microsoft httpクライアントのnugetを追加しました。あなたのコードの関連部分を投稿することは、常に良いアイデアです

関連する問題