【发布时间】:2014-03-17 20:49:08
【问题描述】:
使用 mvvmCross 文件插件时,我收到以下错误。我尝试使用使用“文件插件 3.1.1-beta”的 N-14 代码示例,但我得到了错误,我还使用了一个全新的项目,从 nuGet 下载了最新的插件版本,我也得到了同样的错误。
这似乎和这个人遇到的问题一样:
https://github.com/MvvmCross/MvvmCross/issues/510
这似乎是错误信息中的主线:
Failed to resolve parameter for parameter fileStore of type IMvxFileStor
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.GetIoCParameterValues (System.Type type, System.Reflection.ConstructorInfo firstConstructor) [0x00000] in <filename unknown>:0
我已经尝试重新启动 xamarin studio 和我的 MacPro 等。我已经使用了 location 和 messenger 插件,没有任何问题
请指教
追踪:
2014-03-17 20:37:44.836 MCOTaxiIOS[2730:60b] TouchNavigation:Diagnostic: 0.56 导航请求 [0:] TouchNavigation:Diagnostic: 0.56 导航请求 将“/Developer/Projects/MCO/MCO.IOS/Views/FirstView.cs:58,1”处的挂起断点解析为 MonoTouch.UIKit.UIViewController MCO.IOS.Views.FirstView.CreateTabFor(字符串标题、字符串 imageName、Cirrious。 MvvmCross.ViewModels.IMvxViewModel viewModel) [0x0002f]。 [0:] 2014-03-17 20:37:44.875 MCOIOS[2730:60b] mvx:Diagnostic: 0.59 请求为空 - 假设这是在构造期间调用 ViewDidLoad 的 TabBar 类型的情况......现在修补请求 - 但要注意施工期间虚拟呼叫的问题 [0:] mvx:Diagnostic: 0.59 请求为空 - 假设这是在构造期间调用 ViewDidLoad 的 TabBar 类型情况...现在修补请求 - 但要注意构造期间虚拟调用的问题 将“/Developer/Projects/MCO/MCO.Common/Services/LocationService.cs:110,1”处的挂起断点解决为 void MCO.Common.LocationService.OnError(Cirrious.MvvmCross.Plugins.Location.MvxLocationError 错误)[0x00001] . [0:] 2014-03-17 20:37:44.917 MCOIOS[2730:60b] mvx:Warning: 0.64 创建 FirstViewModel 类型的 viewModel 时出现问题 - 问题 MvxIoCResolveException:创建 MCO.Common.ViewModels.FirstViewModel 时无法解析 IMvxFileStore 类型的参数 fileStore 的参数 在 Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.GetIoCParameterValues(System.Type 类型,System.Reflection.ConstructorInfo firstConstructor)[0x00000] in :0 在 Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.IoCConstruct(System.Type 类型)[0x00000] 中:0 在 Cirrious.CrossCore.Mvx.IocConstruct (System.Type t) [0x00000] in :0 在 Cirrious.MvvmCross.ViewModels.MvxDefaultViewModelLocator.TryLoad (System.Type viewModelType, IMvxBundle parameterValues, IMvxBundle savedState, IMvxViewModel& viewModel) [0x00000] in :0 [0:] mvx:警告:0.64 创建 FirstViewModel 类型的 viewModel 时出现问题 - 问题 MvxIoCResolveException:创建 MCO.Common.ViewModels.FirstViewModel 时无法解析 IMvxFileStore 类型的参数 fileStore 的参数 在 Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.GetIoCParameterValues(System.Type 类型,System.Reflection.ConstructorInfo firstConstructor)[0x00000] in :0 在 Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.IoCConstruct(System.Type 类型)[0x00000] 中:0 在 Cirrious.CrossCore.Mvx.IocConstruct (System.Type t) [0x00000] in :0 在 Cirrious.MvvmCross.ViewModels.MvxDefaultViewModelLocator.TryLoad (System.Type viewModelType, IMvxBundle parameterValues, IMvxBundle savedState, IMvxViewModel& viewModel) [0x00000] in :0
堆栈跟踪:
System.Reflection.TargetInvocationException:调用的目标已抛出异常。 ---> System.Exception:无法从定位器 MvxDefaultViewModelLocator 构造和初始化类型 CollectABull.Core.ViewModels.FirstViewModel 的 ViewModel - 检查 MvxTrace 以获取更多信息 在 Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest 请求,IMvxBundle savedState,IMvxViewModelLocator viewModelLocator)[0x00000] 在:0 在 Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest 请求,IMvxBundle savedState)[0x00000] 在:0 在 Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.LoadViewModel (IMvxTouchView touchView) [0x00000] in :0 在 Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods+c_DisplayClass1.b_0 () [0x00000] in :0 在 Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCreate(IMvxView 视图,System.Func`1 viewModelLoader)[0x00000] 在:0 在 Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.OnViewCreate (IMvxTouchView touchView) [0x00000] in :0 在 Cirrious.MvvmCross.Touch.Views.MvxViewControllerAdapter.HandleViewDidLoadCalled (System.Object sender, System.EventArgs e) [0x00000] in :0 at at (wrapper delegate-invoke) :invoke_void_this__object_EventArgs (object,System.EventArgs) 在 Cirrious.CrossCore.Core.MvxDelegateExtensionMethods.Raise (System.EventHandler eventHandler, System.Object sender) [0x00000] in :0 在 Cirrious.CrossCore.Touch.Views.MvxEventSourceTabBarController.ViewDidLoad () [0x00000] in :0 在 /Developer/Projects/MCO/MCO.IOS/Views/FirstView.cs:26 中的 MCO.IOS.Views.FirstView.ViewDidLoad () [0x00002] 在 /Developer/Projects/MCO/MCO.IOS/Views/FirstView.cs:18 中的 MCO.IOS.Views.FirstView..ctor () [0x0000f] at at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) 在 System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] 参数) [0x00002] 在 /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:537
【问题讨论】:
-
您是否在 Core PCL 项目和 iOS 项目中都安装了该插件?确保 File 插件有一个 Bootstrap 类。这就是 Mvx 自动注册插件的方式。
-
就是这样,我没有将插件添加到IOS项目中!你能回答这个问题以便我接受吗?