Search code examples
c#sqlitexamarinmvvmcross

MvvmCross 4 and WPF SQLite plugin


In MvvmCross 4.0.0 the Community SQLite plugin has been replaced with new SQLite-PCL plugin (if I am not mistaken).

It works great in my Android application, but when I tried to use it in WPF application I faced problems.

  1. When package is installed from nuget there's no default Bootstrap file, therefore Mvx runtime fails to resolve classes like MvxSqliteConnectionFactory.
  2. When I add bootstrap code manually I get error like:

    A first chance exception of type Cirrious.CrossCore.Exceptions.MvxException occurred in WindowsBase.dll Version Unknown : Time 26/10/2015 08:53:16.232 PM: Error : 1.30 Exception: could not load plugin assembly for type MvvmCross.Plugins.Sqlite.PluginLoader

I figured that runtime is not able to load assembly probably because it does lookup by appending .Wpf suffix to the name of the plugin, so it looks for assembly MvvmCross.Plugins.Sqlite.Wpf or something like that. But there's no such library, in repository there's only WindowsUWP version.

What can I do to fix the problem and how do I use this plugin in WPF app?


Solution

  • WPF plugin added to MvvmCross repos, please check out the latest prerelease version.