Discussion:
[sqlite] Use System.Data.Sqlite in Mono on a ARM based Panel
Jochen Kuehner
2016-04-24 11:49:07 UTC
Permalink
I've a Project, wich should run on Windows and a Mono ARM based Panel.

On Windows I use System.Data.Sqlite (Core) nuget! Now on Mono I want to also use System.Data.Sqlite, because Monos sqlite Part has some Bugs! But fro mono I need taht it looks for sqlite3.so and not the Interop Dll. Wich Nuget Package can I use for this? If I include System.Data.Sqlite (MSIL) it also searches for the Interop DLL and not the sqlite3.so! Wich is the right one? (Also sqlite-netFx451-binary-Mono-2013-1.0.101.0.zip from Homepage is looking for interop dlls)

________________________________

MLOG Logistics GmbH, Sitz: D-74196 Neuenstadt
Registergericht: Amtsgericht Stuttgart HRB 100594
Geschäftsführer: Hans-Jürgen Heitzer, Jochen Strauß
Joe Mistachkin
2016-04-25 01:26:58 UTC
Permalink
Jochen Kuehner wrote:
>
> Wich is the right one? (Also
sqlite-netFx451-binary-Mono-2013-1.0.101.0.zip
> from Homepage is looking for interop dlls)
>

That is the right one. The interop DLL is being used because it has special
options to support managed virtual table implementations, etc. To compile
an
interop DLL for Mono, please grab the source code, extract it, and then use
the following script (or something like it):

http://urn.to/r/kJ

--
Joe Mistachkin
Jochen Kuehner
2016-04-28 05:40:47 UTC
Permalink
I've now compiled the Library with this script without problems.
(I changed it that the output filename ist: SQLite.Interop.dll

But when I copy it to my ARM based Panel I always get this Exception:

System.DllNotFoundException: SQLite.Interop.dll
at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods:sqlite3_config_none (System.Data.SQLite.SQLiteConfigOpsEnum)
at System.Data.SQLite.SQLite3.StaticIsInitialized () [0x00000] in <filename unknown>:0
at System.Data.SQLite.SQLiteLog.Initialize () [0x00000] in <filename unknown>:0
at System.Data.SQLite.SQLiteConnection..ctor (System.String connectionString, Boolean parseViaFramework) [0x00000] in <filename unknown>:0
at System.Data.SQLite.SQLiteConnection..ctor (System.String connectionString) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteConnection:.ctor (string)

I've also tried to copy the compiled output to sub-folder "arm/"
and I treied to add <add key="PreLoadSQLite_ProcessorArchitecture" value="arm" /> to my app settings

And I've tried with the System.data.Sqlite.dll from the nuget package, and with the one from "sqlite-netFx451-binary-Mono-2013-1.0.101.0.zip"! (But if it's possible I'd like to use the nuget package, because we also use the application on windows)

Any Idea's?
________________________________________
Von: sqlite-users-***@mailinglists.sqlite.org [sqlite-users-***@mailinglists.sqlite.org]&quot; im Auftrag von &quot;Joe Mistachkin [***@mistachkin.com]
Gesendet: Montag, 25. April 2016 03:26
An: 'SQLite mailing list'
Betreff: Re: [sqlite] Use System.Data.Sqlite in Mono on a ARM based Panel

Jochen Kuehner wrote:
>
> Wich is the right one? (Also
sqlite-netFx451-binary-Mono-2013-1.0.101.0.zip
> from Homepage is looking for interop dlls)
>

That is the right one. The interop DLL is being used because it has special
options to support managed virtual table implementations, etc. To compile
an
interop DLL for Mono, please grab the source code, extract it, and then use
the following script (or something like it):

http://urn.to/r/kJ

--
Joe Mistachkin

_______________________________________________
sqlite-users mailing list
sqlite-***@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

________________________________

MLOG Logistics GmbH, Sitz: D-74196 Neuenstadt
Registergericht: Amtsgericht Stuttgart HRB 100594
Geschäftsführer: Hans-Jürgen Heitzer, Jochen Strauß
Joe Mistachkin
2016-04-28 06:13:55 UTC
Permalink
Jochen Kuehner wrote:
>
> I've now compiled the Library with this script without problems.
> (I changed it that the output filename ist: SQLite.Interop.dll
>
<snip>

Please try without changing the output file name. Mono has its
own special transformations on the P/Invoke library names. The
file names used by the build scripts are set to those specific
values for good reason.

--
Joe Mistachkin
Jochen Kuehner
2016-04-28 07:47:07 UTC
Permalink
Found the Problem!

When I run my exceutable with MONO_LOG_LEVEL=debug

I see that mono searches for libSQLite.Interop.dll

after enaming it works!
________________________________________
Von: sqlite-users-***@mailinglists.sqlite.org [sqlite-users-***@mailinglists.sqlite.org]&quot; im Auftrag von &quot;Joe Mistachkin [***@mistachkin.com]
Gesendet: Donnerstag, 28. April 2016 08:13
An: 'SQLite mailing list'
Betreff: Re: [sqlite] Use System.Data.Sqlite in Mono on a ARM based Panel

Jochen Kuehner wrote:
>
> I've now compiled the Library with this script without problems.
> (I changed it that the output filename ist: SQLite.Interop.dll
>
<snip>

Please try without changing the output file name. Mono has its
own special transformations on the P/Invoke library names. The
file names used by the build scripts are set to those specific
values for good reason.

--
Joe Mistachkin

_______________________________________________
sqlite-users mailing list
sqlite-***@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

________________________________

MLOG Logistics GmbH, Sitz: D-74196 Neuenstadt
Registergericht: Amtsgericht Stuttgart HRB 100594
Geschäftsführer: Hans-Jürgen Heitzer, Jochen Strauß
Loading...