4

I am working on a windows forms application. when I run the application on windows 8 (VS2012), the application runs upto an extent and then crashes, giving the exception "{"Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}".

I am unable to include sqlite3 dll in the references. when I try adding it and change the Copy Local attribute to True, I am unable to do it as whenever I build the solution, this attribute gets changed to False automatically. also when I try adding SQLite3 through the release\x64 folder, I get an error that the file is not accessible. kindly help me fix this issue!!

Sid
  • 79
  • 1
  • 9

1 Answers1

5

Add the x64 (64 bit) version of sqlite3.dll to the folder that contains your executable file.
Make sure you unblocked the file. You can unblock it by right-clicking on it in the Windows Explorer. In the lower right corner of the General tab you should see an "Unblock" button.

You can't add it as a reference, because it isn't a .NET assembly.

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
  • I tried doing that.. now I am getting the following error: "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" – Sid Jun 03 '13 at 10:24
  • @Sid: OK, so the problem is something else. I changed my answer, please check. – Daniel Hilgarth Jun 03 '13 at 10:26
  • I tried this too.. this is the error I get: "Unable to find an entry point named 'sqlite3_open_v2' in DLL 'sqlite3'.":"" – Sid Jun 03 '13 at 10:37
  • @Sid: This sounds like a versioning mismatch and should be asked as a new question. – Daniel Hilgarth Jun 03 '13 at 10:38
  • this is the solution to the problem: I added a dll named SQLite.Tests into my solution and removed Sqlite3.dll from it. It worked well and now I am not getting any exceptions. – Sid Jun 10 '13 at 09:16