Looking for the right combination of SQLite dll and .Net Framework RRS feed

  • Question

  • Does anyone here know which combinations of SQLite DLLs and .Net Framework levels work?  I've been researching and flailing about and have yet to find the right combination.

    In my naive first attempt I was getting an exception before any of my code even got control. 

    Then I backed up the .Net level to 2.0 and the resulting .exe executed but there were many, many compile time warnings.

    Now I am using .Net 4.5 and a SQLite DLL which is supposed to work with 4.5 but I am getting this run time error: Could not load file or assembly 'System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    I've come across changes to app.config which apparently allow some combinations to work which would not work otherwise.  But since I don't really understand app.config files I don't to mess around there without complete instructions.

    Does anyone know the answer or where I might find it?  (I've tried most of the likely places.)

    Thanks,  Bob

    • Edited by Tuesday, March 11, 2014 1:03 PM
    Tuesday, March 11, 2014 1:02 PM


  • This is probably not a .NET version issue.  .NET 4.5 can load assemblies compiled against earlier versions.

    Rather this looks like a bitness issue "An attempt was made to load a program with an incorrect format.".  SQLLite has some unmanaged DLLs and those must your program's bitness.  So if the DLLs are 32bit, you must run your code in a 32bit process.  You can dumpbin the dll to see its bitness.



    Tuesday, March 11, 2014 3:56 PM