I'm trying access a SQLite database from my Windows Phone 8 app but am encountering the following error whenever SQLite code is hit:
{System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at Sqlite.Sqlite3.sqlite3_open_v2(String filename, Database& db, Int32 flags, String zVfs)
at SQLite.SQLite3.Open(String filename, Database& db, Int32 flags, IntPtr zVfs)
at SQLite.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks)
at TopoMap.Map.MapTileServer.<Initialise>d__0.MoveNext()}
The project runs fine with no issues until a line of code is hit that accesses the underlying Sqlite3 class.
Any ideas what the issue might be?
Add compilation cofiguration
7.1 Right-click the project and select Properties.
7.2 Select the Build tab.
7.3 In the Configuration list, select All Configurations.
7.4 In the Platform list, select All Platforms.
7.5 On the Build tab, you’ll see Conditional compilation symbols under the General header, containing a default value of SILVERLIGHT;WINDOWS_PHONE on a Windows Phone app project. Change the value to SILVERLIGHT;WINDOWS_PHONE;USE_WP8_NATIVE_SQLITE and save the project file.
Right-click References and select add reference.Go to Windows Phone -> Extensions and check the option SQlite for Windows Phone
It works for me!! Good luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With