Search code examples
wpfxamarinwindows-phone-8.1mvvmcross

Failed to resolve parameter for parameter factory of type ISQLiteConnectionFactory when creating


When we are using Xamarin and MvvmCross to build a project for Phone. In this project we have added a SQLite db using SQLite plugin from MvvmCross, we have also added the SQLite3 dll to our debug folder. When we build everything is fine, but when we run the application we get the following exception:

Exception {Cirrious.CrossCore.Exceptions.MvxIoCResolveException: Failed to construct LocalPersistDataService ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

From the output: A first chance exception of type 'System.DllNotFoundException' occurred in Cirrious.MvvmCross.Plugins.Sqlite.WindowsCommon.DLL

Using Visual Studio 2013 and Windows Phone 8.1 RT


Solution

  • We solved it with adding an package from sqlite.org and then got (out of nothing day 2) a reference in our add Reference on Windows Phone, this link might be of help to others with the same problem. (Down on the page there is a section on WPF)

    http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/databases/