none
System.Data.SQLite.dll Is Not Found RRS feed

  • Question

  • I am creating a WPF application; this application does work and works well on my development machine. The problem is that when I take my 'Release' compiled executable and SQLite DLL to the client machines it crashes (with no messages, just get a Windows Crash Report). If I recompile my code without the references to the SQLite DLL the UI starts up just fine. I am placing the DLL in the same folder as the executable, which worked just fine in previous projects I've done. I'm just not sure if something is new in .NET 4.0 or VS 2010 that I am not aware of. Help and pointers are appreciated.

    I already asked this similar question in the developers forums of the SQLite DLL. http://sqlite.phxsoftware.com/forums/p/2169/8821.aspx#8821
    Tuesday, January 19, 2010 2:41 AM

All replies

  • Hi,
    may be the version of the sqllite dll not compatible with .NET framework 4.0.check the sqllite dll requirements.hope it helps.
    Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you
    Tuesday, January 19, 2010 5:12 AM
  • Well a good start would be adding proper error handling to your main function so that you don't end up with the windows error report but with the actual exception that is causing you grief, once you know whats wrong fixing it gets alot easier :)
    Tuesday, January 19, 2010 3:09 PM
  • As an aside...Sql lite is finicky when dealing with 32vs64 bit as well. I was using ELMAH error reporting for asp.net and the tool's use of SQLLite (and other non managed assemblies/dlls) caused me to not use the tool due to compile problems on target 64 bit machines. Grrr
    William Wegerson (www.OmegaCoder.Com)
    Tuesday, January 19, 2010 3:20 PM
    Moderator
  • AFAIK, the version I have been using was specifically created for .NET 4.0 Beta 2. So I am fairly certain that is not the issue. But I will of course double check.

    Thank you for the input.
    Tuesday, January 19, 2010 3:31 PM
  • Ray,
    Do you have any suggestions as to what the error handling should be? Should I be wrapping the InitializeComponents() method? How do you do error handeling in XAML because that is where the SQLite object is being initialized.
    Tuesday, January 19, 2010 3:32 PM
  • Sorry overlooked the fact that its an wpf application, you can can either add an alternative entrypoint (see code sample on bottom of the page) to your application or handle the Application.DispatcherUnhandledException event.
    Tuesday, January 19, 2010 3:58 PM
  • If it is crash caused by native code (not a managed exception), then run it under (native) debugger (windbg, Visual Studio) and see what kind of exception (probably AV) from which component causes the crash.

    -Karel
    Tuesday, January 19, 2010 5:10 PM
    Moderator
  • Karel and Ray,

    Thanks for your input. I will be trying both of these solutions tonight (I don't work on this project for my day job). Programming is more of a hobby of mine. I will report back my findings tonight.

    The only further question at this time would be that I have never done debugging without VS. What, if anything, do I need to do to get the debugging support on another machine? Just copy the windbg executable from my development machine to my production machine?

    Best regards,
    Ryan
    Tuesday, January 19, 2010 8:15 PM
  • windbg needs couple of more DLLs than just the main executable, but it is possible to just copy it over (I use it that way).

    -Karel
    Wednesday, January 20, 2010 12:46 AM
    Moderator
  • Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies. The specified module could not be found.
    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089      code_base: , None,
    PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35      code_base: , None,
    System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089      code_base: , None,
    System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089      code_base: , None,
    WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35      code_base: , None,
    System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139      code_base: , None,
    System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089      code_base: , None,
    PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35      code_base: , None,
    System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089      code_base: , None,
       at TimeTracker.DataConnection..ctor()
       at TimeTracker.App.Application_DispatcherUnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e)
       at System.Windows.Threading.Dispatcher.CatchException(Exception e)
       at System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source, Exception e)
       at System.Windows.Threading.ExceptionWrapper.CatchException(Object source, Exception e, Delegate catchHandler)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


    I have caught the exception above. I have no idea why the assembly cannot be loaded; the assembly is in the same directory as the executable. Any hints as to how I am supposed to setup the project to make this work? Or how to add it to the GAC?
    Wednesday, January 20, 2010 3:01 AM
  • Hi, Ryan:
         Just aside, here are 2 refs related to installing assembly to GACs.
         1. How to install an assembly into the Global Assembly Cache in Visual C#
             http://support.microsoft.com/kb/815808
         2. Global Assembly Cache Tool (Gacutil.exe)
             http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx

        Hope these could help some.

    Thanks,
    Sam        
    Thursday, January 21, 2010 8:34 AM
  • Where is the Gacutil.exe for .NET 4? I found the 3.5 version of the gacutil.exe but cannot find the 4.0 version. Sam, thanks for the tip!
    Thursday, January 21, 2010 2:59 PM
  • I viewed the fusion log, to see bind failures (see below). It seems that it successfully loads the "managed" portion of the System.Data.SQLite library. When the Native Images part loads though I get a ExplicitBind!FileName=(TimeTracker.exe) [First Error] and an error from the System.Data.SQLite library [Second Error].

    I really don't understand what I am reading here so pointers would be helpful.


    *** Assembly Binder Log Entry (1/23/2010 @ 5:06:21 PM) ***
    The operation failed.
    Bind result: hr = 0x80070002. The system cannot find the file specified.

    Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.21006\clr.dll
    Running under executable C:\Path\To\Project\bin\Debug\x86\TimeTracker.exe

    --- A detailed error log follows.

    LOG: Start binding of native image TimeTracker, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=x86.
    WRN: No matching native image found.
    LOG: Bind to native image assembly did not succeed. Use IL image.
    LOG: IL assembly loaded from C:\Path\To\Project\bin\Debug\x86\TimeTracker.exe.


    *** Assembly Binder Log Entry (1/23/2010 @ 5:06:21 PM) ***
    The operation failed.
    Bind result: hr = 0x80070002. The system cannot find the file specified.

    Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.21006\clr.dll
    Running under executable C:\Path\To\Project\bin\Debug\x86\TimeTracker.exe

    --- A detailed error log follows.

    === Pre-bind state information ===
    LOG: User = MyComputer-PC\Ryan
    LOG: DisplayName = System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
    (Fully-specified)
    LOG: Appbase = file:///Path/To/Project/bin/Debug/x86/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = TimeTracker.exe
    Calling assembly : TimeTracker, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null.
    ===

    LOG: Start binding of native image System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139.
    WRN: No matching native image found.

    • Edited by Ryan Lovelett Saturday, January 23, 2010 11:28 PM Formatting bad.
    Saturday, January 23, 2010 11:22 PM
  •  

    Thanks for refer following post

    ________________________________________________________________________________________________________

    Harga Jual Blackberry iPhone Laptop Murah | Harga Jual Laptop Murah | Harga Jual Blackberry Murah | Harga Jual iPhone Murah

    Sunday, March 13, 2011 5:48 AM
  • This is an old question but for anyone with this problem in the future, consider using NuGet to install SQLite into your project.


    Sam Hobbs
    SimpleSamples.Info

    Saturday, April 22, 2017 8:18 PM