Hello!

I'm trying to use SQLite in an ASP.NET 2.0 application. I ran the x86
installer (sqlite-netFx35-setup-bundle-x86-2008-1.0.79.0.exe), then
added a reference in Visual Web Developer Express and copied the
version independent XML for DbProviderFactories from the included help
file into my app.config file.

When I visit the page in my browser, I get the following error:

---
Failed to find or load the registered .Net Framework Data Provider.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException:
Failed to find or load the registered .Net Framework Data Provider.

Source Error:


Line 29:                
Line 30:                // Stuff things into DB
Line 31:                DbProviderFactory factory =
DbProviderFactories.GetFactory("System.Data.SQLite");
Line 32:                using (DbConnection conn = factory.CreateConnection())
Line 33:                {


Source File: c:\Windows\Web\RDWeb\Pages\Scan3\Scan.aspx    Line: 31

Stack Trace:


[ConfigurationErrorsException: Failed to find or load the registered
.Net Framework Data Provider.]
   System.Data.Common.DbProviderFactories.GetFactory(DataRow
providerRow) +2253507
   System.Data.Common.DbProviderFactories.GetFactory(String
providerInvariantName) +184
   ASP.scan3_scan_aspx.Page_Init(Object sender, EventArgs e) in
c:\Windows\Web\RDWeb\Pages\Scan3\Scan.aspx:31
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,
Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e) +42
   System.Web.UI.Control.OnInit(EventArgs e) +132
   System.Web.UI.Page.OnInit(EventArgs e) +16
   System.Web.UI.Control.InitRecursive(Control namingContainer) +143
   System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+11056792
   System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+11056490
   System.Web.UI.Page.ProcessRequest() +91
   System.Web.UI.Page.ProcessRequest(HttpContext context) +240
   ASP.scan3_scan_aspx.ProcessRequest(HttpContext context) in
c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\rdweb_pages\decbd09c\9f1642a3\App_Web_z-cvbhdp.3.cs:0
   
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +171

---



So I went back and ran the test application that System.Data.SQLite
installer put on the start menu. It also throws an error:

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

************** Exception Text **************
System.BadImageFormatException: Could not load file or assembly
'System.Data.SQLite, Version=1.0.79.0, Culture=neutral,
PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An
attempt was made to load a program with an incorrect format.
File name: 'System.Data.SQLite, Version=1.0.79.0, Culture=neutral,
PublicKeyToken=db937bc2d44ff139'
   at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark)
   at System.RuntimeType.PrivateGetType(String typeName, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName)
   at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
   at System.Data.Common.DbProviderFactories.GetFactory(String
providerInvariantName)
   at test.TestCasesDialog.runButton_Click(Object sender, EventArgs e)
in c:\dev\sqlite\dotnet\test\TestCasesDialog.cs:line 109
   at System.Windows.Forms.Control.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.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

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].



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5448 (Win7SP1GDR.050727-5400)
    CodeBase: 
file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
test
    Assembly Version: 1.0.79.0
    Win32 Version: 1.0.79.0
    CodeBase: 
file:///C:/Program%20Files%20(x86)/System.Data.SQLite/2008/bin/test.exe
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5447 (Win7SP1GDR.050727-5400)
    CodeBase: 
file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)
    CodeBase: 
file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: 
file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: 
file:///C:/Windows/assembly/GAC_64/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: 
file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: 
file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

---


What am I doing wrong?

 --James
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to