1

The desktop software (.Net 4.0, compiled under Visual Studio 2010, target: x86) I'm developing is shipping with System.Data.SQLite (1.0.86 for x86, from system.data.sqlite.org*) for the first time.

On the development machine (And every other machine where the System.Data.SQLite-installer has run), everything works correctly.

On the testing machine however, after installation (a standard MSI setup created with the Visual Studio Installer) launching the application and showing the splash screen, before showing the GUI, the application creates an exception with the error:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies.

The mentioned file itself is found in the application directory (correct version), along with all the other referenced DLLs.

I assume this works on the development machines because of the setup option 'Install images'. I didn't install SQLite in the GAC. The application project is directly referencing the pre-build System.Data.SQLite.dll with local copy set to true.

Are there any dependencies I'm not seeing? Or is it a missing Microsoft Visual C++ Runtime Library (Not present in the application directory)? Or a missing SQLite.Interop.DLL (Not present in the application directory)?

How could I fix those?

Christian Studer
  • 24,947
  • 6
  • 46
  • 71

1 Answers1

3

Ensure that you have the latest Microsoft Visual C++ 2010 Redistributable Package installed. http://www.microsoft.com/en-gb/download/details.aspx?id=5555

Why? The sqlite DLL has some unmanaged code embedded in it that is run directly from the assembly at runtime. This manifested for me as a bad image format exception but you never know!

Gusdor
  • 14,001
  • 2
  • 52
  • 64
  • I was suspecting something like that. Now, I have to find out, how I can force the user to have this installed... – Christian Studer Jun 21 '13 at 08:25
  • How are you deploying the application? I use installshield and simply add the redistributable to the prerequisite list. You can, however, search the registry http://stackoverflow.com/questions/12206314/detect-if-visual-c-redistributable-for-visual-studio-2012-is-installed. Steam (for example) always installs on first run of every app. This is irritating, but recommended. – Gusdor Jun 21 '13 at 13:00