I’ve taken over an old js project and am trying to convert it to C#.
It uses sqlite and thus sqllite3.dll
When I run the conversion script I get these errors:
Conversion aborted due to compilation errors: C:\Users\mgsta\Box Sync\Penn\IBI\3dHeatMap\3DHM-proj-Csharp\Assets\Convergence Assets\Scripts\HeatVRML.js(3,8): BCE0021: Namespace ‘Mono.Data.Sqlite’ not found, maybe you forgot to add an assembly reference? C:\Users\mgsta\Box Sync\Penn\IBI\3dHeatMap\3DHM-proj-Csharp\Assets\Convergence Assets\Scripts\HeatVRML.js(104,22): BCE0018: The name ‘SqliteDataReader’ does not denote a valid type (‘not found’). C:\Users\mgsta\Box Sync\Penn\IBI\3dHeatMap\3DHM-proj-Csharp\Assets\Convergence Assets\Scripts\HeatVRML.js(105,26): BCE0018: The name ‘SqliteConnection’ does not denote a valid type (‘not found’). C:\Users\mgsta\Box Sync\Penn\IBI\3dHeatMap\3DHM-proj-Csharp\Assets\Convergence Assets\Scripts\HeatVRML.js(106,21): BCE0018: The name ‘SqliteCommand’ does not denote a valid type (‘not found’). C:\Users\mgsta\Box Sync\Penn\IBI\3dHeatMap\3DHM-proj-Csharp\Assets\Convergence Assets\Scripts\HeatVRML.js(293,22): BCE0005: Unknown identifier: ‘SqliteConnection’.
I tried adding a ref to the dll using the ‘-r’ option because I didn’t know what else to do. And unsurprisingly (since if I understand correctly, an assembly should just be compiled IL code, and my sqlite3.dll is an unmanaged binary?) it didn’t work:
Format of the executable (.exe) or library (.dll) is invalid.
The error messages means the converter could not resolve the types used to access sqllite.
It looks like to me that you need to reference Microsoft.Data.Sqlite.dll or Mono.Data.Sqlite.dll (not sure which one your project uses, if any of those at all)
Are you running the tool, from command line? Or are you using the Unity Editor integration ?
I was referencing the sqlite3.dll in my project Plugins folder. But as I’m starting to understand, that’s an unmanaged binary, and I need to ref a managed dll that wraps/refs the actual unmanaged code in sqlite3.dll?
Googling Mono.Data.Sqlite.dll brought me to the Mono project sqlite page, but no download of this file. It just pointed to download of the sqlite download with sqlite.dll (that I’d gotten previously to get a 64-bit version).
I searched in the Unity install dir and found many Mono.Data.Sqlite.dll files. Ref’ing one of these from the UnityScript2CSharp script works.
Does it matter much which one I ref? There are many versions (many under MonoBleedingEdge folder which I figured were best to skip). I went with: