System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: e95fe9493d892efd402b86d5d24b635ded8cdc1b
Title: at app start, I get exception can not load aseembly System.Data.SQLite
Status: Closed Type: Incident
Severity: Minor Priority: Zero
Subsystem: Integration_Via_PInvoke Resolution: Works_As_Designed
Last Modified: 2012-01-29 15:26:25
Version Found In: 1.0.79.0
Description:
I use Windows XP with sqlite-netFx40-setup-bundle-x86-2010-1.0.79.0. This is my develop computer with visual studio 2010.

When I try to execute the application in other computer, in this case Windows 7 x64, when I star application I get the following error:

Could not load file or assembly 'System.Data.SQLite, Version=1.0.79.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. It has tried to load a program with an incorrect format.

However, in the develop computer, the application start correctly.

I my project of visual studio, I add the references to the two dlls, SQLite an Linq and in both cases I select local copy.

Also, in the config.xml y use the prvider configuration, which I copy from the xml of the test application that I get from the bin folder:

<system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite" /> <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.79.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data>

But the problem persist.

I try the 32 bits version and the 64 bits (in this case I copy to local the two 64 bits dll). The problem it's the same.

is it neccesary to install sqlite-netFx40-setup-bundle-x86-2010-1.0.79.0 in the Windows 7 PC? I would like to have a potable application, in which it has not been needed to install extra applications.

Thanks.


mistachkin added on 2012-01-28 23:21:11 UTC:
In order to use System.Data.SQLite on 64-bit Windows, you'll need the x64 package, not the x86 one.


anonymous added on 2012-01-29 07:57:03 UTC:
In windows 7 x64, do I always need the x64 package or only if the application is compiled in 64 bits?

Because I try the two version, compile in 32 bits with the 32 bits dlls, and compile in 64 bits and use the 64 bits dlls from the bin folder of the 64 bits package. In both cases I get the same error.

Also, I use the option local copy of the dlls, so if I don't wrong, copying only the dlls in the application folder is enough.

Thanks.


anonymous added on 2012-01-29 15:26:25 UTC:
The problem is resolved.