[Mono-list] Single .dll targeted at multi platform but using sqlite, possible?

KeithBoynton keithboynton at flaredesign.co.uk
Sat Aug 25 13:23:11 UTC 2012


I'm so nearly there I can taste it.

To summarise so far, I had to scrap the idea of going down the CSharp-Sqlite
route as I got blocked with the LockEx issue even though I was using the
most recent released version of the code base.

I'm trying to Mono.Data.SqLite route and have it compiling and running
successfully on OSX however the final hurdle is that it compiles on Windows
but I get an exception when trying to run it. It's worth noting that I'm
building in Windows in Visual Studio 2010.

The exception I get is:
System.TypeInitializationException at Mono.Data.Sqlite.SqliteConvert.Split

Which is thrown by this code (the .Open() method is where it dies):
_dbConnectionString =
String.Format("URI=file:{0},Version=3,BusyTimeout=100", "test.db");
_databaseConnection = new SqliteConnection(_dbConnectionString);
_databaseConnection.Open();

I know folks have Mono.Data.Sqlite working successfully on Windows so if
anyone would mind sharing how they managed to get it to work in Windows and
perhaps more specifically in Visual Studio I'd be most grateful.

Complete stack trace here:
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 SoundHound.DatabaseManager..ctor(String inputFile) in
DatabaseManager.cs:line 45
       at SoundHound.DataAccessManager..ctor() in DataAccessManager.cs:line
22
       at SoundHound.ApplicationLogic..ctor(MediaPlayer mediaPlayer) in
ApplicationLogic.cs:line 105
       at SoundHound.MainGUI..ctor() in MainGUI.cs:line 52
       at SoundHound.Program.Main() in Program.cs:line 31
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
String[] args)
       at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly,
String[] args)
       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
       at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext, String[] activationCustomData)
       at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext)
       at System.Activator.CreateInstance(ActivationContext
activationContext)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  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: 



--
View this message in context: http://mono.1490590.n4.nabble.com/Single-dll-targeted-at-multi-platform-but-using-sqlite-possible-tp4656335p4656398.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list