Arsal
Arsal

Reputation: 388

Unable to load DLL 'sqlite3': in windows phone app.

I'm working on a windows Phone OLD application. I'm getting this issue related to SQL3.dll. in visual 2015.

Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

What I've tried, Done Cleaning all project, added sqlite.dll in Bin/debug folder, but I could not overcome this issue. here is a screenshot. enter image description here

I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible. Any help would be appreciated.

Upvotes: 0

Views: 161

Answers (2)

Soonts
Soonts

Reputation: 21936

I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible.

SQlite is distributed as a VS extension. To add reference to your project, right click on References, “Add References”, “Windows Phone 8”, “Extensions”, check “SQLite for Windows Phone”, press OK.

No other steps are required, you don’t need other references and you don’t need to specify or deploy DLLs manually.

Also sqlite has different extension for WP8.1, you should probably install another one, sqlite-wp81-winrt-3220000.vsix.

Update: I think you’re trying to build for a platform that’s unsupported by SQLite library. SQlite for windows phone only supports 2 platforms, intel 32 bit (for emulators) and ARM (for devices and for the marketplace). It does not support AMD64, and it does not support “Any CPU”. You’re probably trying to build “Any CPU”, it’s usually the default platform for .NET.

Another possible reason is wrong project type. Your project has to be windows phone 8.1 app, not universal, i.e. the project name in the solution explorer panel must end with ”(Windows Phone 8.1)”

Update 2: I’ve compiled a simple app that uses sqlite, run it in emulator and it worked flawlessly on my PC. Ensure your references look like this: sqlite-test-references.png

If you have the same, make sure you have VS 2015 Update 3 installed. If you already have it, repairing your visual studio installation might help.

Upvotes: 0

Edwin Bentveld
Edwin Bentveld

Reputation: 101

Add the dll as a reference:

  1. Right-click in "References" in the project you want to use it in and select "Add reference".
  2. Select the option "Browse" and use the browse button to select the dll you want to include.
  3. Add a using statement to the class.

After this you can use the dll in the project.

Upvotes: 0

Related Questions