Here’s the situation – I have a vb.net exe compiled for X86 machines using 2 dll’s… Because one of the dll’s was only provided in 32 bit, and I didn’t want to have to deal with 32/64 versions, I forced 32 bit in compile options and everything was fine. Now I have a 64 bit workstation that is throwing an error about the sqlite.dll (error #1 below)… after reading around I am starting to understand a lot of people are having this issue. I tried replacing the dll on the client machine with the 64 bit version of sqlite and that didn’t work (error #2). I read somewhere that the 64 bit version requires VC 2010 redistro, but that didn’t work. I can’t compile this app as a 64 bit because of the other dll is 32 bit. Any help is greatly appreciated.
Error #1 – System.InvalidOperationException: No connection associated with this command
Error #2 – System.BadImageFormatException: Could not load file or assembly ‘System.Data.SQLite, Version=1.0.79.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: ‘System.Data.SQLite, Version=1.0.79.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139’
Are you absolutely sure that you’ve compiled your application under x86, not AnyCPU? When dealing with dlls like SQLLite that are compiled for x86, your process must be running in x86 mode.