1

I tried to select geometry field from sqlite db.
Tried this guide https://gist.github.com/lydonchandra/5023e1076c338748b5c8

    static bool is64bitProcess()
    {
        return (IntPtr.Size == 8);
    }

    static bool is32bitProcess()
    {
        return (IntPtr.Size == 4);
    }

 internal void SqliteTest()
    {
        string mod_spatialite_folderPath = "mod_spatialite-4.3.0a-win-amd64";

        if (is64bitProcess())
        {
            Console.WriteLine("64bit process");
            mod_spatialite_folderPath = "mod_spatialite-4.3.0a-win-amd64";
        }
        else if (is32bitProcess())
        {
            Console.WriteLine("32bit process");
            mod_spatialite_folderPath = "mod_spatialite-4.3.0a-win-x86";
        }

        using (var conn = new SQLiteConnection(ConnectionString))
        {
            conn.Open();
            conn.LoadExtension($@"{mod_spatialite_folderPath}\mod_spatialite");

            conn.Close();
        }
   }

But on line:

conn.LoadExtension($@"{mod_spatialite_folderPath}\mod_spatialite");

I got error that can't find libfreexl-1.dll

I see that this dll exists in folder with mod_spatialite.dll.
What can i miss?

Kliver Max
  • 5,107
  • 22
  • 95
  • 148

0 Answers0