Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

SQLite-PCL plugin throws DLL not found exception when using database #57

Open
Vovanella95 opened this issue Feb 2, 2016 · 8 comments
Open

Comments

@Vovanella95
Copy link

When I add SQLite-PCL plugin into my Visual Studio 2015 project a have "Dll not found exception", because sqlite3.dll is missing. Pleace, fix this problem :)

@Cheesebaron
Copy link
Member

What version? What kind of project? Do we have to guess?

@Vovanella95
Copy link
Author

My project have Myproject.Core class library. I installed MvvmCross.StarterPack 4.0.0-beta8, then installed Mvvmcross.Plugin.SQLitePCL 4.0.0-beta8. Then in my FirstViewModel I try to get IMvxSqliteConnectionFactory

public class FirstViewModel 
         : MvxViewModel
     {
         private readonly SQLite.Net.SQLiteConnection _connection;
         public FirstViewModel(IMvxSqliteConnectionFactory factory)
         {
             _connection = factory.GetConnection("database1.sql");
         }
     }

After that launch my Windows Phone 8 project (using MvvmCross.StarterPack 4.0.0-beta8 and MvvmCross.Plugins.SQLitePCL-beta8) I have

http://cs630416.vk.me/v630416231/16f84/bf0J4Etmm7w.jpg

Maybe I doing something wrong, but I seen same problems on stackoverflow.com and face with it myself. Thank you for attantion

@Cheesebaron
Copy link
Member

You mean Windows Phone 8.1 Universal?

Anyways I believe this might be an issue in the SQLiteNet-PCL nuget and not ours. As that is a dependency. I'll make sure next release uses a newer version if present, hopefully that solves the issue.

But if you are doing a Windows Phone 8 Silverlight project this is a wontfix as it is just not supported.

@Vovanella95
Copy link
Author

I have Windows Phone 8 App (not silverlight and not universal). Simple Windows Phone App. So thank you for quick answering 👍

@Cheesebaron
Copy link
Member

You app must be a WPA81 target otherwise this wont work.

@thongdoan
Copy link

I have same issue(but with windows phone 8.1 silverlight), fixed it by add SQLite for Windows Phone 8.1 extension(follow: https://code.msdn.microsoft.com/windowsapps/WindowsPhone-8-SQLite-96a1e43b)

Then add WP8SqliteConnectionFactory.cs (https://gist.github.com/thongdoan/70733e04e43668b30db2)
into your wp8 project, then on method InitializeFirstChance (Setup.cs) add
Mvx.RegisterSingleton(() => new WP8SqliteConnectionFactory());

Hope it helpful

@rickduarte
Copy link

Thank you @thongdoan!
This works for Windows Phone 8.0 Silverlight too.
Just one thing: The code for RegisterSingleton is
Mvx.RegisterSingleton<IMvxSqliteConnectionFactory>(() => new Wp8SqliteConnectionFactory());

@eshy
Copy link

eshy commented Mar 16, 2016

I don't remember if support for WP8 silverlight was dropped in MVX4 or not but at least for this plugin the only difference from the other Windows plugins would be the returned CurrentPlatform (returning SQLitePlatformWP8).

I have it working on a local fork, I can create a PR if it makes sense

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants