LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by AKRRKA » Tue 26 Nov 2013 15:27

Hello,

Discovered another big problem.
SQLite does not work on Win 8.1 x64.

On Windows 8 x86-x64, 7 x86-x64 works good.
On Windows 8.1 does not works!

After copy sqlite3.dll from "c:\Program Files (x86)\Devart\dotConnect\Universal\Providers\" to application folder. get error as screenshot №2.

Example project: WindowsFormsApplication15.zip (793.4 КБ) - http://rghost.ru/50464079

PS: For me this problem, and others are very important. Please correct them as soon as possible.

screenshot №1 - Without sqlite3.dll.
Full - http://s5.hostingkartinok.com/uploads/i ... e77bb5.png
Image

screenshot №2 - With sqlite3.dll.
Full - http://s3.hostingkartinok.com/uploads/i ... 40d739.png
Image

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by MariiaI » Wed 27 Nov 2013 10:37

Generally, the sqlite3.dll is included in the LinqConnect installation and there are 2 versions available in these folders:
- C:\Program Files (x86)\Devart\dotConnect\SQLite
- C:\Program Files (x86)\Devart\dotConnect\SQLite\x64

You are getting the error on the screenshot #2 due to the fact that the incorrect version of the sqlite3.dll is used. To resolve this issue you may use one of the following ortions:
- either use sqlite3.dll from C:\Program Files (x86)\Devart\dotConnect\SQLite\x64 folder,
- or set Platform Target to x86 instead of AnyCPU in the Properties of your project.

As for the fact, that dotConnect Universal provides only one version of sqlite3.dll, we will fix this situation and make x86 и x64 versions available.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by AKRRKA » Wed 27 Nov 2013 11:47

Hmmm,

1) I need create AnyCPU application. How use sqlite3.dll from
- c:\Program Files (x86)\Devart\dotConnect\SQLite\
and
- c:\Program Files (x86)\Devart\dotConnect\SQLite\x64\
with my AnyCPU app?
Please show me an example. And make changes to the my project from first post:
WindowsFormsApplication15.zip (793.4 КБ) - http://rghost.ru/50464079

2) And now work on Win 7 x64, 8 x64, and don`t work only on Win 8.1 x64. How it work on WIn 8 x64?

Full screen: http://s6.hostingkartinok.com/uploads/i ... deb5b6.png
Image

Thanks.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by MariiaI » Thu 28 Nov 2013 09:49

We have tested your application on Windows 7 x64 with the sqlite3.dll from the dotConnect Universal installation package and we get the same error as on Windows 8.1 x64 ("An attempt was made to load a program with an incorrect format").

In your case, most likely, the following occurs - when running your application on computers with Windows 7,8 x64 the sqlite3.dll x64 is searched in the bin folder of your application first of all. Due to the fact that there is an x32 version (you put there sqlite3.dll from the dotConnect Universal folder) it continues searching in other system folders - such as Windows/SysWOW64. Most likely that sqlite3.dll x64 is available somewhere on the computer and everything works ok, while there is no sqlite3.dll on Windows 8.1, except the bin folder of your application.

> How use sqlite3.dll from with my AnyCPU app?
Generally, if you have (or had) dotConnect for SQLite/LinqConnect Professional installed on the computer, you shouldn't care about this.
Your application should have access to the engine library sqlite3.dll when it is deployed and is used on the computer where no engine library sqlite3.dll is available. You should put it either to the application folder or in a system-wide accessible folder. We have put sqlite3.dll from C:\Program Files (x86)\Devart\dotConnect\SQLite\x64 to the bin folder of your application and successfully tried it on the computer without LinqConnect installation. We are sending you a sample project to the e-mail address you have provided in your forum profile. Please check that the letter is not blocked by your mail filter.

Please tell us about the results.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by AKRRKA » Thu 28 Nov 2013 12:24

I understand. That's what I did for the test, and the problem disappeared.
But. I ask another.

For example, to work with the library System.Data.SQLite (http://system.data.sqlite.org), I use the following folder structure:

Code: Select all

File name                      Size              
---------------------------    ---------------   
ceShell.View.Win.exe                   549,888   
System.Data.SQLite.dll                 253,440   
System.Data.SQLite.Linq.dll            182,784   
x64\                                             
   SQLite.Interop.dll                  946,688   
x86\                                             
   SQLite.Interop.dll                  700,928   

total files 5    total size       2,633,728
And in this case, at the start on 32-bit Windows automatically uses x86 version of the library, and at the start on 64-bit Windows, used x64 version.
In this case the application (ceShell.View.Win.exe) itself compiled as AnyCPU.

See docs: http://system.data.sqlite.org/index.htm ... loads.wiki
Using Native Library Pre-Loading
The final step is to identify the target processor architecture on both the development and customer machines. Generally, x86 binaries will work on an x64 machine running Windows (using WoW64). However, there is a problem when using managed code. If the executable that starts the process consists entirely of managed code, it will run with the native processor architecture of the machine, which will be x64 on an x64 machine. Later on, this will cause assemblies containing any native code compiled for x86 (e.g. the "System.Data.SQLite.dll" mixed-mode assembly, the "SQLite.Interop.dll" native interop assembly, or the "sqlite3.dll" native library) to fail to load, typically resulting in a BadImageFormatException being thrown.

If the development and customer machines may have different processor architectures, more than one binary package may be required. For this situation, using the native library pre-loading feature is highly recommended. It is available as of version 1.0.80.0 and enabled by default. In order to take advantage of this feature, the separate managed and interop assemblies must be used with XCOPY deployment (i.e. this feature is not supported by the mixed-mode assembly, nor when the assembly is deployed to the global assembly cache), resulting in an application deployment that looks something like this:

\App.exe (optional, managed-only application executable assembly)
\App.dll (optional, managed-only application library assembly)
\System.Data.SQLite.dll (required, managed-only core assembly)
\System.Data.SQLite.Linq.dll (optional, managed-only LINQ assembly)
\x86\SQLite.Interop.dll (required, x86 native interop assembly)
\x64\SQLite.Interop.dll (required, x64 native interop assembly)

...
I need AnyCPU application.
How to do the same with Devart component???
Please show an example based on my application.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by MariiaI » Thu 28 Nov 2013 14:07

Thank you for the additional information.
The "Native Library Pre-Loading" feature is not implemented in LinqConnect/dotConnect for SQLite. We will consider the possibility to add this functionality and inform you about the results as soon as any are available.

Currently, the only solution for your scenario is to put the corresponding sqlite3.dll libraries (x86 and x64) to these directories:
- C:\Windows/System32
- C:\Windows/SysWOW64

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by AKRRKA » Thu 28 Nov 2013 15:41

MariiaI wrote: Currently, the only solution for your scenario is to put the corresponding sqlite3.dll libraries (x86 and x64) to these directories:
- C:\Windows/System32
- C:\Windows/SysWOW64
Windows 8.1 x64.
After copy x64 sqlite3.dll to C:\Windows/SysWOW64 also dont` work, only after copy to application directory all work
And it is not good, which of the two copied to the application folder.

Full screenshot: http://s3.hostingkartinok.com/uploads/i ... 8787f4.png
Image

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by MariiaI » Fri 29 Nov 2013 15:00

We have investigated this issue in more details. Yes, you are right, this solution (to put the corresponding sqlite3.dll libraries x86 and x64 to the C:\Windows\System32 and C:\Windows\SysWOW64 folders) doesn't work on Windows 8.1 x64.
This is related to file system redirector and that fact that executables use C:/Windows/System32 folder.

We will consider the possibility to implement the "Native Library Pre-Loading" feature to simplify solving of such issues and inform you about the results as soon as possible.
Temporary workarounds are:
- install dotConnect for SQLite/LinqConnect in minimal/compact installation mode (if possible);
- put one version of sqlite3.dll to C:\Windows\System32 and another to the bin folder of your application.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by AKRRKA » Mon 02 Dec 2013 14:27

MariiaI wrote: - install dotConnect for SQLite/LinqConnect in minimal/compact installation mode (if possible);
This is not possible.
MariiaI wrote: - put one version of sqlite3.dll to C:\Windows\System32 and another to the bin folder of your application.
This is don`t work.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by MariiaI » Wed 04 Dec 2013 10:53

The "Native Library Pre-Loading" feature has been implemented. It will be available in the next public build of LinqConnect. We will inform you when it is available for download.
Also, the next public build of dotConnect Universal will include both sqlite3.dll versions for x86 and x64.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by MariiaI » Fri 13 Dec 2013 06:19

New build of LinqConnect 4.4.393 is available for download now!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=28506.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by AKRRKA » Fri 13 Dec 2013 08:19

Please show me an example. And make changes to the my project from first post:
WindowsFormsApplication15.zip (793.4 КБ) - http://rghost.ru/50464079

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by MariiaI » Fri 13 Dec 2013 15:17

We have sent you a sample project to the e-mail address you have provided in your forum profile. Please check that the letter is not blocked by your mail filter. Please test it and tell us about the results.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.4.374 (14-Nov-2013) - SQLite dont work on Win 8.1 x64

Post by AKRRKA » Fri 13 Dec 2013 15:47

Thank you very much.
Everything works as it should.

Post Reply