I created a C # project in Visual Studio and used the assembly in SQLite 4.0 ADO Library from http://sqlite.phxsoftware.com/ .
The program works fine on the development machine, but when I try to run it on another system, an error always occurs stating that System.Data.SQLite.dll cannot be found. I put the file in the program directory. I also tried putting it in the directory specified in the PATH section. Any suggestions?
I am using openFileDialog to open a database. Here's the corresponding code:
con = new SQLiteConnection(); OpenFileDialog ofd1 = new OpenFileDialog(); ofd1.Filter = "db Datei (*.db)|*.db|Alle Dateien (*.*)|*.*"; if (ofd1.ShowDialog() == DialogResult.OK) filepath = ofd1.FileName; filepath.Replace("\\", "\\\\"); con.ConnectionString = "Data Source= \"" + filepath + "\""; [...]
As already mentioned, this works on a development machine (Windows 7, 64 bit). The test machine runs in a virtual box (Windows 7, 32 bit). The following exception occurs:
System.IO.FileNotFoundException: Die Datei oder Assembly "System.Data.SQLite.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Das angegebene Modul wurde nicht gefunden. Dateiname: "System.Data.SQLite.dll" bei WindowsFormsApplication1.Form1.button2_Click(Object sender, EventArgs e) bei System.Windows.Forms.Control.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ButtonBase.WndProc(Message& m) bei System.Windows.Forms.Button.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Geladene Assemblys ************** mscorlib Assembly-Version: 4.0.0.0. Win32-Version: 4.0.30319.1 (RTMRel.030319-0100). CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll. ---------------------------------------- WindowsFormsApplication1 Assembly-Version: 1.0.0.0. Win32-Version: 1.0.0.0. CodeBase: file:///C:/Users/andi/Documents/My%20Dropbox/Own%20Public%20Folders/Public%20(Andy%20Malessa)/juralookup(Wir%20brauchen%20dringend%20nen%20Namen)/DataManagementTool/WindowsFormsApplication1.exe. ---------------------------------------- System.Windows.Forms Assembly-Version: 4.0.0.0. Win32-Version: 4.0.30319.1 built by: RTMRel. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll. ---------------------------------------- System.Drawing Assembly-Version: 4.0.0.0. Win32-Version: 4.0.30319.1 built by: RTMRel. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll. ---------------------------------------- System Assembly-Version: 4.0.0.0. Win32-Version: 4.0.30319.1 built by: RTMRel. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll. ---------------------------------------- System.Windows.Forms.resources Assembly-Version: 4.0.0.0. Win32-Version: 4.0.30319.1 built by: RTMRel. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll. ---------------------------------------- mscorlib.resources Assembly-Version: 4.0.0.0. Win32-Version: 4.0.30319.1 (RTMRel.030319-0100). CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_de_b77a5c561934e089/mscorlib.resources.dll. ----------------------------------------
Thus, basically it says: "System.Data.SQLite.dll" or the dependency was not found.
The file is present in the application directory. Here is the list of files: 
source share