Sql – ASP.NET 2.0 Application with a Sqlite Backend on Mono

apacheasp.netmonosqlite

I have an extensive ASP.NET Sqlite driven application that will run through Apache with the help of Mono. For testing purposes, I created an application that has two textboxes and a button. When the textboxes are filled with text and the button is executed, a Sqlite table will receive the text within the textboxes. This test application works in Visual Studio.

I published the test application and placed it on the apache server. The Sqlite .db file sits in the bin folder, and my connection string points directly to this folder. When I run the application, the textboxes and button show up, but when I press the button I receive the following error:

Server Error in '/' Application
System.Data.SQLite.DLL
Description: HTTP 500. Error processing request.

Stack Trace:

System.DllNotFoundException: System.Data.SQLite.DLL at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods:sqlite3_open_interop (byte[],int,intptr&) at System.Data.SQLite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) [0x00000]

at System.Data.SQLite.SQLiteConnection.Open () [0x00000] at WebApplication1._Default.ExecuteQuery (System.String txtQuery) [0x00000] at WebApplication1._Default.Button1_Click (System.Object sender, System.EventArgs e) [0x00000]

at System.Web.UI.WebControls.Button.OnClick (System.EventArgs e) [0x00000] at System.Web.UI.WebControls.Button.RaisePostBackEvent (System.String eventArgument) [0x00000] at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (System.String eventArgument) [0x00000]

at System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, System.String eventArgument) [0x00000] at System.Web.UI.Page.RaisePostBackEvents () [0x00000] at System.Web.UI.Page.ProcessRaiseEvents () [0x00000]

at System.Web.UI.Page.InternalProcessRequest () [0x00000] at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000]

The system.data.sqlite.dll file is actually in the bin with the sqlite .db file. Does anyone know how to resolve this error?

Thank you,

DFM

Best Answer

This managed version of the ADO.NET provider for SQLite requires the native sqlite3.dll or Linux shared library from http://www.sqlite.org It looks like the dll is missing: "DllNotFoundException"

Related Topic