Author Topic: Elve and sqlite  (Read 1694 times)

mld2112

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Elve and sqlite
« on: July 23, 2014, 03:21:37 pm »
SQLite has been the bane of my existence. If I didn't have to use it for a 3rd party database I would never ever use it. Rant over. Can anyone tell me what the trick is to get the PITA SQLite to work in Elve?

I get this error when starting the driver:

Date:     7/23/2014
Time:     6:05:21 PM
Severity: Error
Source:   DriverService
Computer: HOMENET
Context Type: None
Context Name:
Description:
The assembly 'System.Data.SQLite, Version=1.0.93.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' byte array was returned from the master server but failed to load. FileLoadException: Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402)

System.IO.FileLoadException: Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402)
   at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
   at System.Reflection.Assembly.Load(Byte[] rawAssembly)
   at DriverService.Program.AssemblyLoadFailedHandler(Object sender, ResolveEventArgs e)


And


Date:     7/23/2014
Time:     6:05:21 PM
Severity: Error
Source:   DriverService
Computer: HOMENET
Context Type: None
Context Name:
Description:
Failed to start device 'ECM1240'.

FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.93.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.
FileNotFoundException FusionLog: WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.93.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Data.SQLite, Version=1.0.93.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
   at ECMEngine.ECMEngine.get_RecordCount()
   at ECMEngineDriver.ECMEngineDriver.StartDriver(Dictionary`2 configFileData)
   at DriverService.DriverService2.createAndStartDevice(Object parameter)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Jonathan B

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Elve and sqlite
« Reply #1 on: July 25, 2014, 05:24:27 am »
This looks to me like the normal issue with native DLLs. SQLite is not a managed library so when Elve calls "Assembly.Load" it fails because you cannot load native DLLs that way in .NET. They have to be in the GAC or the main executable program folder (or technically any other place you set the probe directive to in the .config file for .NET if you created one) but they cannot be loaded "on the fly" as a plugin.

So my suggestions for what it is worth are either to try copying the SQLite to the Elve Program Files folder or installing it into the GAC (both on the master AND the driver machines if they are separate). Or, try using the managed SQLite library someone created at https://code.google.com/p/csharp-sqlite/

Good luck!

mld2112

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Elve and sqlite
« Reply #2 on: July 29, 2014, 11:28:54 am »
Installing it did work, thanks for your help. So much for the "just copy the files" idea.

Matt