5

What do I need to use SQLite with NHibernate (and FluentNHibernate) ?

There is:

System.Data.SQLite.dll and System.Data.SQLite.Linq.dll, (ADO.NET 2.0 provider) available from http://sourceforge.net/projects/sqlite-dotnet2/

and

sqlite3.dll available as binary download http://www.sqlite.org/download.html

What is the difference? Do I need both, or which one?

The first option installs to C:/...Program Files. Can I copy it from there to my custom SharedLibs folder, or will something reference the files originally installed?

bretddog
  • 5,411
  • 11
  • 63
  • 111

1 Answers1

11

You only need System.Data.SQLite.dll. You could reference this assembly in your SharedLibs folder and it should be enough. The sqlite3.dll is unmanaged code containing the databae engine itself and it is embedded as resource inside the managed System.Data.SQLite assembly. Also because of this unmanaged code there are actually two versions of the System.Data.SQLite assembly: one for x86 and one for x64, so make sure you reference the correct one for your system.

You could download this assembly from here: http://sqlite.phxsoftware.com/

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • 1
    I second Darin's recommendation. To clarify, `System.Data.SQLite` and `sqlite-dotnet2` are two completely separate projects. I've used `System.Data.SQLite` and been quite happy with it - they have active forums, etc. – Stephen Cleary Feb 04 '11 at 12:38
  • It doesn't look like a separate project - the http://sqlite.phxsoftware.com/ download link goes to the sqlite-dotnet2 sourceforge page. – Michael Low Feb 04 '11 at 12:42
  • I Installed Package System.Data.SQLite.x64 in VS2013 on win7. But, I got error: An unhandled exception of type 'System.DllNotFoundException' occurred in Devart.Data.SQLite.dll Additional information: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E) – user3448011 Mar 22 '16 at 21:41
  • @user3448011 might be worth double-checking exactly what you installed. Because an error occurring in DEVART.Data.SQLite.dll suggests it is a different SQLite driver – fostandy Oct 06 '21 at 11:05