0

I am writing a C# appli that uses SQLite with extensions. However it throws an exception on this line

cnn.LoadExtension("SQLite.Iterop.dll", "sqlite3_json_init");

Now there are a lot of similar questions to this, so please don't just mark this as "duplicate" without reading, since I have already tried the solutions of those questions.

I will tell here what I ve tried:

  1. Some answers suggest to use Nuget to install System.Data.SQlite.Core. I have already checked and it is already installed
  2. Some other answersuggested including the dlls in X86 and X32 folders to the project. I tried to do this but first the folders don't get included, and when I include the dlls the error is still there
  3. Some other answer suggested to just copy manually the dlls into the bin Debug folder. Already tried that, it does not work
  4. Another answer suggested to setup the platform target from AnyCPU to x86 for example. I tried that and that also fails

How can the program find this dlls (that is under both x86 and x32 folder in the Debug folder)

KansaiRobot
  • 7,564
  • 11
  • 71
  • 150

1 Answers1

0

For "cannot find file" errors the best tool Process Monitor.

Quickly stop the Trace, clear the Trace, then get ready to repro the problem, Process Monitor works in real-time and logs a lot of information so you will want to be quick to capture the problem.

Once the problem has happened stop the Trace. I prefer to save it as a CSV and in Excel use the Sort button and look for "Path Not Found".

You need to see where the PC is looking for the DLL/file and put it where its expected. As per your option 3.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321