0

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.

Arsal
  • 343
  • 2
  • 8
  • 21
  • This type of question has previously been answered [here](https://stackoverflow.com/questions/9003072/unable-to-load-dll-module-could-not-be-found-hresult-0x8007007e) – Software Dev Mar 27 '18 at 22:04
  • I've applied many of those solutions like, adding dll in system32 folder, adding dll file in bin folder. but both don't works. in your link I checked by installing dependency walker,, where i get that "Error: At least one file was not a 32-bit or 64-bit Windows module." not found any clue – Arsal Mar 27 '18 at 22:23

2 Answers2

0

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.

  • The package is already referenced that's why it throws an exception,isn't it obvious ? – Software Dev Mar 27 '18 at 22:25
  • SQLite reference is already added. This was working fine before, there might be some kind of path issue. I checked the path folder but there is no folder with name "Packages\\58576Appdsgn.Raamweg_6v6nrq06e3jsy\\TempState"" you can have a look in attached screenshot. – Arsal Mar 27 '18 at 22:31
  • The dll should be in the project folder. It is automatically added there. – Edwin Bentveld Mar 27 '18 at 22:43
  • is there a specific place in project folder? because I added in bin folder but didn't work. – Arsal Mar 27 '18 at 22:52
  • For the debug version "..\bin\debug". For the release version "..\bin\release". – Edwin Bentveld Mar 29 '18 at 18:02
0

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.

Soonts
  • 20,079
  • 9
  • 57
  • 130
  • This is already Done. SQLite for Windows Phone 8.1 (version 3.15.1) is already checked and I can see in References. Moreover I tried adding sqlite-wp81-winrt-3220000.vsix via browsing and I got error that "a reference could not be added. Please make sure the file is accessible, and that is a valid assemble or COM Component". is there any other way to add this? or there is any other issue – Arsal Mar 28 '18 at 00:14
  • I'm trying to build with intel 32 bit on emulator (x86). I didn't try with Any CPU because when I choose that then SQL error display. Moreover Yes You're right, My Project type is Windows Phone 8.1. Not Universal. – Arsal Mar 28 '18 at 07:39