Search code examples
c#mvvmcross

MVVM Cross could not load plugin assembly for type MvvmCross.Plugins.Email.PluginLoader


I updated to MvvmCross Beta 3. Now it seems it can't find my plugins on Windows 10 UWP anymore.

This exception is thrown on start:

An exception of type 'Cirrious.CrossCore.Exceptions.MvxException' occurred in Cirrious.CrossCore.dll but was not handled in user code

Additional information: could not load plugin assembly for type MvvmCross.Plugins.Email.PluginLoader

I added the mail plugin via NuGet and added a bootstrapper to the project:

using Cirrious.CrossCore.Plugins;

namespace MoneyManager.Windows.Bootstrap
{
    public class EmailPluginBootstrap
        : MvxPluginBootstrapAction<MvvmCross.Plugins.Email.PluginLoader>
    {
    }
}

enter image description here

You can find the repository on GitHub: https://github.com/NPadrutt/MoneyManager

On Android the startup still works without any problem after adjusting the namespaces. Is there some known issue in the beta 3 or is there wrong in my setup?

Thanks NPadrutt


Solution

  • This is a bug on MVVMCross 4(since it´s beta).

    But it's a simple fix:

    On your UWP Setup.cs, override method LoadPlugins and add this:

    Mvx.RegisterType<IMvxComposeEmailTask, MvxComposeEmailTask>();

    Comment or remove the Bootstrap for this plugin and it should work.

    Edit: Bug has been fixed on the source code of MVVMCross(#1142), but still no new version has been made available on NuGet.