mercredi 26 août 2015

SQLite not able to locate System.Data.SQLite.dll

I would like to get some help with a web service and desktop app that interface with a SQLite database all using .Net.

I need to provide some history here. I have a dev PC, demo server and production server. I have a web site that has user GUI interface and some web services running on the back end. I have coded a desktop app that calls these web services to transfer data. This functionality has been live online for over 3 years.

The recent update to .Net 4 required updates to the SQLite.dll for compatibility with the newer .Net. I went through a long process of migrating code and other libraries. Everything progressed well and worked and has been live for a few months, until the past few days when seemingly out of the blue the SQLite.dll is not being detected on the production server.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)

at System.Data.SQLite.SQLite3.StaticIsInitialized()

at System.Data.SQLite.SQLiteLog.Initialize()

at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)

at System.Data.SQLite.SQLiteConnection..ctor()

at MultiLangWeb.openConnnection.openPttDBconn(String fulldbNamePath)

at MultiLangWeb.ptt_input.Button2_Click(Object sender, EventArgs e)

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Here is the real crazy part here. I use the one click publish routine, when I deploy to the demo server everything work, when I deploy to the production server it fails. I can call the demo server from my dev PC, it works, when I call production server from dev PC. But when I compile and open the app it fails.

I Publish with the System.Data.SQLite.dll INCLUDE required in the Application Files settings of Visual Studio.

I have check the GAC on the server and even tried installing the dll using the GACUTIL, it all appears to be set up correctly, but obviously something is looking in the wrong place for this dll.

I noted also that the error is stating 'SQLite.Interop.dll' yet the file I am trying use is System.Data.SQLite.dll .

Not sure if that is by design.

Aucun commentaire:

Enregistrer un commentaire