无法加载程序集MVVMCross

时间:2013-06-25 17:31:20

标签: mono xamarin.android xamarin mvvmcross

我有一个问题是加载由NuGET加载的MVVMCross库(如N视频所示)。这是我的pluginloader:

        private void InitialisePlugins()
        {
            PluginLoader.Instance.EnsureLoaded();

            Cirrious.MvvmCross.Plugins.File.PluginLoader.Instance.EnsureLoaded();
            Cirrious.MvvmCross.Plugins.JsonLocalisation.PluginLoader.Instance.EnsureLoaded();
            Cirrious.MvvmCross.Plugins.ResourceLoader.PluginLoader.Instance.EnsureLoaded();
            Cirrious.MvvmCross.Plugins.Messenger.PluginLoader.Instance.EnsureLoaded();
       }

异常(似乎文件未加载,但已在目录输出中复制):

>     06-25 16:57:27.538 I/mvx     (  717):   4.21 Setup: PluginManagerFramework start
>     mvx:Diagnostic:  4.21 Setup: PluginManagerFramework start
>     [0:] mvx:Diagnostic:  4.21 Setup: PluginManagerFramework start
>     06-25 16:57:27.611 I/mono-stdout(  717): mvx:Diagnostic:  4.21 Setup: PluginManagerFramework start
>     [0:] 
>     06-25 16:57:27.708 I/mvx     (  717):   4.38 Setup: App start
>     mvx:Diagnostic:  4.38 Setup: App start
>     [0:] mvx:Diagnostic:  4.38 Setup: App start
>     06-25 16:57:27.788 I/mono-stdout(  717): mvx:Diagnostic:  4.38 Setup: App start
>     [0:] 
>     06-25 16:57:27.949 I/mvx     (  717):   4.62 Loading plugin assembly: Cirrious.MvvmCross.Plugins.File.Droid.dll
>     mvx:Diagnostic:  4.62 Loading plugin assembly: Cirrious.MvvmCross.Plugins.File.Droid.dll
>     06-25 16:57:28.028 I/mono-stdout(  717): mvx:Diagnostic:  4.62 Loading plugin assembly: Cirrious.MvvmCross.Plugins.File.Droid.dll
>     [0:] mvx:Diagnostic:  4.62 Loading plugin assembly: Cirrious.MvvmCross.Plugins.File.Droid.dll
>     Unhandled Exception:
>     
>     Cirrious.CrossCore.Exceptions.MvxException: Loading...
>     06-25 16:57:47.188 E/mono    (  717): 
>     06-25 16:57:47.188 E/mono    (  717): Unhandled Exception:
>     06-25 16:57:47.188 E/mono    (  717): Cirrious.CrossCore.Exceptions.MvxException: Could not load file or
> assembly 'Cirrious.MvvmCross.Plugins.File.Droid.dll' or one of its
> dependencies. The system cannot find the file specified. --->
> System.IO.FileNotFoundException: Could not load file or assembly
> 'Cirrious.MvvmCross.Plugins.File.Droid.dll' or one of its
> dependencies. The system cannot find the file specified.
>     06-25 16:57:47.188 E/mono    (  717): File name: 'Cirrious.MvvmCross.Plugins.File.Droid.dll'
>     06-25 16:57:47.188 E/mono    (  717):   at System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence
> assemblySecurity, Boolean refonly) [0x00000] in <filename unknown>:0 
>     06-25 16:57:47.188 E/mono    (  717):   at System.AppDomain.Load (System.String assemblyString) [0x00000] in <filename unknown>:0 
>     06-25 16:57:47.188 E/mono    (  717):   at (wrapper remoting-invoke-with-check) System.AppDomain:Load (string)
>     06-25 16:57:47.188 E/mono    (  717):   at System.Reflection.Assembly.Load (System.String assemblyString)
> [0x00000] in <filename unknown>:0 
>     06-25 16:57:47.188 E/mono    (  717):   at (wrapper remoting-invoke-with-check) Syst06-25 16:57:47.188 E/mono    (  717): 
> at Cirrious.CrossCore.Plugins.MvxFilePluginManager.LoadAssembly
> (System.Type toLoad) [0x0001e] in
> c:\Projects\Misc\MVVMCROSS\CrossCore\Cirr
>     The program 'Mono' has exited with code 0 (0x0).

1 个答案:

答案 0 :(得分:0)

这篇文章看起来像是nuget和non-nuget方法的奇怪组合。错误消息表明您尚未将文件插件添加到Android应用程序项目中 - 对吗?


除此之外,由于你有nuget设置和工作,我认为如果你在N + 1视频中遵循N = 8和N = 9可能会有用 - 这些讨论如何包含和使用插件。请参阅http://mvvmcross.wordpress.com/处的索引 - 例如: