I need to create and access a spatialite-extended SQLite database under x64 windows.
I have downloaded the latest version 1.0.92.0 called sqlite-netFx45-static-binary-bundle-x64-2012-1.0.92.0.zip
of System.Data.SQLite. It is referenced from my Visual Studio (2012) project, and seems to work just fine by itself.
I also have the latest precompiled x64 spatiaLite version 4.1.1 called spatialite-4.1.1-DLL-win-amd64.zip All the dlls from spatialite are present in the executing directory.
When I try to load the extension:
using (var conn = new SQLiteConnection("Data Source=\"" + _sqLiteFullName + "\""))
{
conn.Open();
conn.EnableExtensions(true);
conn.LoadExtension("libspatialite-4.dll");
...
}
I get an AccessViolationException (Attempted to read protected memory. This is often an indication that other memory is corrupt) on the LoadExtension()
line.
I notice when looked at with PE Deconstructor (software that determines the bitnewss of dll/exe), it says that my copy of System.Data.SQLite.dll (from the x64 package) is actually 32bits. Is that the problem?
How to I remedy this?
How has anyone else got spatiaLite working on x64?