We have changed from sqlite-net to sqlite.net PCL. Our project worked perfectly with the old one - with the release of PCL, now we must explicitly declare our platform using.
var conn = new SQLiteConnection(new SQLitePlatformWin32(), Path.Combine(folderPath, dbName));
But now, when I call this line, we get
SQLite.Net.Platform.Win32.dll introduces the first exception of type exception "System.TypeInitializationException"
Additional information: the type initializer for "SQLite.Net.Platform.Win32.SQLiteApiWin32Internal" made an exception.
Inner exception tells us
{"Failed to load native sqlite library"}
Stacktrace:
on SQLite.Net.Platform.Win32.SQLiteApiWin32Internal.sqlite3_open_v2 (Byte [] filename, IntPtr & db, Int32 flags, IntPtr zvfs)
on SQLite.Net.Platform.Win32.SQLiteApiWin32.Open (Byte [] filename, IDbHandle & db, flags Int32, IntPtr zvfs)
in SQLite.Net.SQLiteConnection..ctor (ISQLitePlatform sqlitePlatform, String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks, follower for IBlobSerializer, IDictionary 2 tableMappings, IDictionary 2 extraTypeMappings, IContractResolver recognizer)
on SQLite.Net.SQLiteConnection..ctor (ISQLitePlatform sqlitePlatform, String databasePath, Boolean storeDateTimeAsTicks, follower for IBlobSerializer, IDictionary 2 tableMappings, IDictionary 2 extraTypeMappings, IContractResolver recognizer)
However, sqlite3.dll is located in the application folder and actually works with a non-circular version. I played with compilation for x86 and x64 and downloaded the latest version of sqlite3.dll for Win32, but all without success. What are we missing?