Get the latest set of files from system.data.sqlite.org.

Binary packages are intended to be used for development and deployment of their applications onto customer machines.  Ensure you select the correct version for the .NET Framework version and Windows 32/64bit version your applicaiton targets.  Select the version without 'mixed-mode assembly' bundle.

(Setup packages are intended for developer machines if the design-time components for Visual Studio are required).

So this is what we do, we want the distribution binaries and we want them statically linked with the visual C++ runtime library in case the user doesn't already have it on their machine.  So this is what we would choose for example:

Precompiled Statically-Linked Binaries for 32-bit Windows (.NET Framework 4.0)

sqlite-netFx40-static-binary-Win32-2010-1.0.94.0.zip

Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 4.0)

sqlite-netFx40-static-binary-x64-2010-1.0.94.0.zip

From the zip copy 'System.Data.SQLite.dll' into your project directory and then add it as a reference.

Copy the following files / directories to your executables directory (debug and release).  These don’t need to be added as a reference in your project:

\System.Data.SQLite.dll (required, managed-only core assembly, from either zip)
\System.Data.SQLite.Linq.dll (optional, managed-only LINQ assembly)
\System.Data.SQLite.EF6.dll (optional, managed-only EF6 assembly)
\x86\SQLite.Interop.dll (required, x86 native interop assembly)
\x64\SQLite.Interop.dll (required, x64 native interop assembly) 

Set the projects .Net framework to match that used and ensure your distribution package / installer is set to install it as a prequesit if necessary.

Thats it!  

32bit vs 64bit

Your project needs to be set to the same platform architecture as that being used for the sqlite dll's.  For C# developers this means not selectecting 'Any CPU'. This means if your main executible will need to be created as 32bit and 64bit and deployed according to the target machine architecture.  Yes sucks, but sqlite uses unmanaged code in its dll so tough!

The x86 and x64 directories will likely solve development issues but if not see the "Using Native Library Pre-Loading" notes here for an important note about managed code applications and 64 vs 32 bit development.

Distributing Your Application

These files from your projects release output folder need to be copied into the applications executable when installed on a users PC:

\System.Data.SQLite.dll (required, managed-only core assembly)
\System.Data.SQLite.Linq.dll (optional, managed-only LINQ assembly)
\System.Data.SQLite.EF6.dll (optional, managed-only EF6 assembly)
\x86\SQLite.Interop.dll (required, x86 native interop assembly)
\x64\SQLite.Interop.dll (required, x64 native interop assembly) 

Ensure the relevant .Net framework is used.

Issues

C# application targetting 'Any CPU' may cause errors and need to be set to the same 32/64 bit version as that downloaded.

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *