Click here to Skip to main content
15,069,665 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Background: We are developing a 32-bit Windows desktop application. Development Environment is 32-bit Windows, Visual Studio 2013, Windows Forms, Microsoft .NET Framework 4 Client Profile, SQLite database (via System.Data.SQLite ADO.NET data provider). SQLite works great in the development environment.

SQLite was installed on our Development systems as instructed:
1. Download sqlite-netFx40-binary-bundle-Win32-2010-1.0.99.0.zip.
2. Extract to: (solution folder)\Externals\
3. Add Reference to: (solution folder)\Externals\System.Data.SQLite

Application deployment is via Inno Setup. System.Data.SQLite.dll and the database are installed to the application install directory.
Have been testing installs on Windows 7 and Windows 8.1. Previously was using an MS Access database, and they always worked until we switched to SQLite. We considered using SQL Server CE, but then learned that it is DEPRECATED because Microsoft is leaning towards platform-independent solutions. Great! So, we went with SQLite.

Problem: Since switching to SQLite, am unable to get the installed application to run on Windows 7 32-bit client. App launch fails with Runtime Error dialog:
An error has occurred in the protection runtime.
Error: 1610
ExtendedError: 167772499
A detailed log can be found here:
(path to log file)
If the problem persists please contact your software supplier.
The log file contains this error message: "System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies. The specified module could not be found.

What I have tried:

Have verified System.Data.SQLite.dll and the database were installed to the application local directory. Microsoft .NET 4 Client Profile has been installed. Have searched the web and see much conflicting/confusing information. This is what the System.Data.SQLite FAQ says:

(9) How do I install System.Data.SQLite on end-user machines?

Strictly speaking, there is no need to install System.Data.SQLite on any end-user machine (e.g. via the setup). The recommended way to deploy the assemblies is "application local" (i.e. copy them to the directory the application is installed to). Installing the assemblies into the Global Assembly Cache is not recommended as it may cause conflicts with other applications installed on the machine.


OK! So, WHAT EXACTLY DO I NEED TO DEPLOY TO THE CLIENT??? What do they mean by
"the assemblies" when it comes to deploying a 32-bit Windows/VB.NET/Windows Forms desktop application with embedded SQLite database???
Posted
Updated 24-Mar-16 16:28pm
Comments
Sascha Lefèvre 24-Mar-16 16:42pm
   
Did you check if System.Data.SQLite.dll has dependencies and if so, included them in the setup?
scrapple7 24-Mar-16 21:47pm
   
Thank you for you quick response. dumpbin reports the following for System.Data.SQLite.dll:

File Type: DLL

Image has the following dependencies:
KERNEL32.dll (Windows NT Base API Client DLL)
ADVAPI32.dll (Advanced Windows 32 Base API)
MSVCR100.dll (Microsoft C Runtime Library)
mscoree.dll (Microsoft .NET Runtime Execution Engine)

Summary
4000 .data
40000 .rdata
6000 .reloc
1000 .rsrc
E2000 .text

I checked Windows\System32\ on DEV and CLIENT PCs, and found ONE difference. The CLIENT does NOT have msvcr100.dll (it does have msvcr100_clr0400.dll)! All other DLLs present and the same version on both PCs.

https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki:

Runtime Library Notes
All downloadable packages on this web page that do not include the word "static" in their file name require the appropriate version (e.g. 2005, 2008, 2010, 2012, 2013, or 2015) of the Microsoft Visual C++ Runtime Library, to be successfully installed on the target machine, prior to making use of the executables contained therein. It should also be noted that the downloadable packages on this web page that include the word "setup" (i.e. the setup packages) already include and will attempt to automatically install the required version of the Microsoft Visual C++ Runtime Library.

My DEV PC has Microsoft Visual C++ 2010 and 2012 Runtime Redistributables installed (must have come with Visual Studio 2013).

What is the CORRECT thing to do? a) modify my setup script to install the entire MS VC++ (2010 or 2012) Redistributable Package, or b) just deliver the required msvcr100.dll? Please keep in mind that I do not want the setup script to have to download any software via the Internet (if we have to, will include the MS VC++ Redistributable installer in our setup program).
Sascha Lefèvre 24-Mar-16 22:22pm
   
I had a hunch it was that one :) I'll write up a small solution.

1 solution

The System.Data.SQLite.dll requires the msvcr100.dll from the VC++ redistributable package.

You should include the whole VC++ redist package simply because it's the recommended procedure.

Ref: Redistributing Visual C++ Files[^]

Sidenote: The msvcr100_clr0400.dll is a "private copy" of the msvcr100.dll for the CLR and shouldn't be used.
Ref: c++ cli - Visual C++ 2010: Changes to MSVC runtime deployment (no more SxS with manifest) - Stack Overflow[^]
   
Comments
Member 10271796 15-Sep-16 10:09am
   
Just brilliant solution. I took ages to sort it out (two days). mscvcr100.dll is the key.
SQLite.Interop.dll not needed at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900