Mono sqlite without mono on windows?

I once asked if there was a way to use sqlite db for windows / linux without two binaries . Someone suggested using mono, and I asked if .NET for Windows required a mono installation, and he was told that no.

I grabbed this link file from my linux vm

mono\gac\Mono.Data.Sqlite\2.0.0.0__0738eb9f132ed756\Mono.Data.Sqlite.dll

Then I wrote these two lines in my main ()

var connection = new Mono.Data.Sqlite.SqliteConnection("Data Source=test.db3");
connection.Open();

I get this exception

System.TypeInitializationException was unhandled
  Message=The type initializer for 'Mono.Data.Sqlite.SqliteConvert' threw an exception.
  Source=Mono.Data.Sqlite
  TypeName=Mono.Data.Sqlite.SqliteConvert
  StackTrace:
       at Mono.Data.Sqlite.SqliteConvert.Split(String source, Char separator)
       at Mono.Data.Sqlite.SqliteConnection.ParseConnectionString(String connectionString)
       at Mono.Data.Sqlite.SqliteConnection.Open()
       at rsa_test.Program.Main(String[] args) in Program.cs:line 56
  InnerException: System.ArgumentException
       Message=Value does not fall within the expected range.
       Source=mscorlib
       StackTrace:
            at System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(Array array, RuntimeFieldHandle fldHandle)
            at Mono.Data.Sqlite.SqliteConvert..cctor()
       InnerException: 

So you cannot use mono-sqlite without mounting? or did i do something wrong?

0
source share
2 answers

I met the same problem and found that dotConnect for SQLite is another solution that is also compatible with Mono and Windows.

0
source

All Articles