我刚刚开始使用MVX,所以希望我已经提供足够的重现。
要点:
使用Ninja创建新解决方案并选择Json和WebBrowser插件。运行WPF应用程序时,会抛出异常:WPF> App.xaml.cs> DoSetup> setup.initialize()
注意:
如果只添加了Json插件,则不会发生此错误。
步骤:
错误:
An unhandled exception of type 'Cirrious.CrossCore.Exceptions.MvxException' occurred in Cirrious.CrossCore.dll
Additional information: could not load plugin assembly for type Cirrious.MvvmCross.Plugins.WebBrowser.PluginLoader
at Cirrious.CrossCore.Plugins.MvxFilePluginManager.LoadAssembly(Type toLoad)
at Cirrious.CrossCore.Plugins.MvxFilePluginManager.FindPlugin(Type toLoad)
at Cirrious.CrossCore.Plugins.MvxPluginManager.ExceptionWrappedLoadPlugin(Type toLoad)
at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePlatformAdaptionLoadedT
at Cirrious.MvvmCross.Plugins.WebBrowser.PluginLoader.EnsureLoaded()
at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePluginLoaded(IMvxPluginLoader pluginLoader)
at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePluginLoaded(Type type)
at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePluginLoadedTType
at Cirrious.CrossCore.Plugins.MvxPluginBootstrapAction1.Load(IMvxPluginManager manager) at Cirrious.CrossCore.Plugins.MvxPluginBootstrapAction1.RunAction()
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.InternalSetResolver(Type tInterface, IResolver resolver)
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.RegisterSingleton(Type tInterface, Object theObject)
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.RegisterSingletonTInterface
at Cirrious.CrossCore.Mvx.RegisterSingletonTInterface
at Cirrious.MvvmCross.Platform.MvxSetup.InitializePluginFramework()
at Cirrious.MvvmCross.Platform.MvxSetup.InitializeSecondary()
at Cirrious.MvvmCross.Platform.MvxSetup.Initialize()
at MvxTest.Wpf.App.DoSetup() in c:\DEVn\MvxTest\MvxTest.Wpf\App.xaml.cs:line 32
at MvxTest.Wpf.App.OnActivated(EventArgs e) in c:\DEVn\MvxTest\MvxTest.Wpf\App.xaml.cs:line 48
at System.Windows.Application.WmActivateApp(Int32 wParam)
at System.Windows.Application.AppFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
答案 0 :(得分:0)
根据我的理解,这个插件根本不存在于WPF中。它与忍者无关。至少我尝试将它添加到Droid项目添加了对文件Cirrious.MvvmCross.Plugins.WebBrowser.dll和Cirrious.MvvmCross.Plugins.WebBrowser.Droid.dll的引用,但如果我这样做它只添加Cirrious.MvvmCross.Plugins .WebBrowser。
这使我得出Cirrious.MvvmCross.Plugins.WebBrowser.Wpf根本不存在的结论,我在这里找到的表(http://www.buildinsider.net/mobile/xamarintips/0053)证实了这一点。
如果我错了,请纠正我。
BR 扬