We changed from sqlite-net to sqlite.net PCL edition. Our project worked fine with the old one - with the PCL edition, we now have to explicitely declare our platform by using.
var conn = new SQLiteConnection(new SQLitePlatformWin32(), Path.Combine(folderPath, dbName));
But now, when I call this line, we get a
A first chance exception of type 'System.TypeInitializationException' occurred in SQLite.Net.Platform.Win32.dll
Additional information: The type initializer for "SQLite.Net.Platform.Win32.SQLiteApiWin32Internal" threw an exception.
The inner Exception tells us
{"Failed to load native sqlite library"}
Stacktrace:
at SQLite.Net.Platform.Win32.SQLiteApiWin32Internal.sqlite3_open_v2(Byte[] filename, IntPtr& db, Int32 flags, IntPtr zvfs)
at SQLite.Net.Platform.Win32.SQLiteApiWin32.Open(Byte[] filename, IDbHandle& db, Int32 flags, IntPtr zvfs)
at SQLite.Net.SQLiteConnection..ctor(ISQLitePlatform sqlitePlatform, String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks, IBlobSerializer serializer, IDictionary
2 tableMappings, IDictionary
2 extraTypeMappings, IContractResolver resolver)at SQLite.Net.SQLiteConnection..ctor(ISQLitePlatform sqlitePlatform, String databasePath, Boolean storeDateTimeAsTicks, IBlobSerializer serializer, IDictionary
2 tableMappings, IDictionary
2 extraTypeMappings, IContractResolver resolver)
However the sqlite3.dll is in the application folder and it actually did work with the unforked version. I played around with compiling for x86 and x64 and downloaded the latest sqlite3.dll for Win32 but all without success. What are we missing?