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()}
- I've installed the Visual Studio extension SQLite for Windows Phone (v3.8.4.3).
- I've installed the sqlite-net-wp8 NuGet package (v3.8.4.3).
- I've added SQLite.cs and SQLiteAsync.cs to my project.
- I've added the USE_WP8_NATIVE_SQLITE conditional compilation symbol to my project.
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