0
votes

Im trying to get a Xamarin forms sqlite up an runnig.

it works fine for Android and iOS, but for windows i get this error. I'm target the solutions for windows phone 8.1 and using Xamarin forms 1.5(I can't upgrade it)

I been following this sample from Xamarin

public class SQLite_WinPhone : ISQLite
    {
        public SQLite_WinPhone() { }
        protected override SQLite.SQLiteConnection GetConnection()
        {
            var sqliteFilename = "TODO.db3";
            string path = Path.Combine(ApplicationData.Current.LocalFolder.Path, sqliteFilename);
            // Create the connection
            var conn = new SQLite.SQLiteConnection(path);
            // Return the database connection
            return conn;
        }
    }

but so far no luck.

have any of you out there bump into this before?

1

1 Answers

0
votes

Android and iOS ship with a SQLite runtime, Windows doesn't.

You need to add:

  1. The SQLitePCL.raw package to your Windows app.
  2. The current c++ runtime package to your windows app
    • Rightclick on references in solution explorer, select Windows > Extensions > Microsoft Visual c++ Runtime Package