Robert Calco wrote:
>
> They are all running .NET 4.5, C# 2012, Debug, AnyCPU mode, and the unit
> tests look identically configured, both on the hard drive and logically in
> their respective solution trees. I used NuGet to install SQLite in both
> solutions, so they each have their own copy in their respective /packages
> directory.
> 

Are these running on the same machine?  Is the operating system 32-bit or
64-bit?  One thing to note is that AnyCPU is basically the same as Win32
(x86) in the System.Data.SQLite solution files.  I'm not sure how your
solution files are configured.

> 
> So, to the naked eye, they seem identical. However, one solutions' unit
> tests run absolutely fine, and the other one throws the error in the
> subject of this email. Both are pulling in the common data layer project
> which is the one that depends on SQLite. both have the following in the
> Debug\bin directory:
> 
> x64\ (folder with 64 bit version of SQLite.Interop.dll in it)
> x86\ (folder with 32 bit version of SQLite.Interop.dll in it)
> 
> ... rest of the binaries required
> 

Ok, the native library pre-loading feature should be in use then.

> 
> I tried configuring all projects in the problem solution to Debug, x86,
> and I even tried dropping the 32-bit version of the SQLite.Interop.dll
> into the bin directory of the unit tests... and STILL I get this error.
> 

Is the operating system 32-bit?  If not, you might want to try building
everything for x64.

> 
> I saw on post, a couple of google searches ago, that indicated perhaps the
> version of the MS runtime DLLs might be the issue. Is it possible that one
> of my projects has a "newer" version of System.Data.SQLite that was
> compiled against a "newer" version of the MS C++ runtime dlls, even though
> they have the same version (1.0.82.0)? (I have not upgraded to the latest
> MS C++ runtime DLLs in my 2012 project, for all kinds of reasons that have
> to do with some of our own C/C++ dependencies in native sub-projects.)
> 

If you are using the official NuGet package, the contained DLLs are all
compiled with the latest version of the corresponding Microsoft Visual C++
runtime libraries for the appropriate processor architecture.

> 
> How should I troubleshoot this?
> 

1. Verify if the operating system is 32-bit or 64-bit.

2. Verify if the application EXE is marked as 32-bit or 64-bit in the header
using CorFlags and/or ILDasm.

3. Run the "depends.exe" tool on the SQLite.Interop.dll and make sure it
does
not find any errors related to missing Visual C++ Runtime DLLs.

>
> And in general how does SQLite work in "AnyCPU" mode if it needs
> SQLite.Interop.dll to run, and there are precisely two mutually exclusive
> versions of it -- 32 and 64 bit?
>

The "AnyCPU" build platform really only applies to managed projects.  For
native projects in the System.Data.SQLite solution files, it simply maps to
Win32 (x86).

--
Joe Mistachkin

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to