in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

Last post 02-12-2011 7:31 AM by wijen. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 01-01-2009 10:18 AM

    • pellelil
    • Top 150 Contributor
    • Joined on 03-04-2008
    • Denmark
    • Posts 9

    Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

    I've been "playing around" with SQLite for WinForm applications for some time, and "for the fun of it" (to learn more about CF) I decided to write a small program for meassuring Fuel-Consumption, that I can install into my phone (running Windows Mobile). As of now I've not yet tried to install it on the phone, but am currently only using the Pocket PC emulator in Visual Studio 2008 (simply trying to debug my program via the Emulator).

    My problem is a soon as I try to execute Conn.Open(); I get the error message "Can't find PInvoke DLL 'SQLite.Interop.060.dll'. I have added System.Data.SQLite (Path = "C:\Program Files (x86)\SQLite.NET\bin\CompactFramework\System.Data.SQLite.dll") to the references of my application. Since the error message mention SQLite.Interop.060.DLL I've tryed to add this file to the references as well, howerver as soon as I does I'm told that: "A reference so 'SQLite.Interop.060.DLL' could not be added.".

    I'm most likely missing some tiny detail, so any pointer in the right direction will be appreciated.

    Pelle

    Filed under: ,
  • 01-01-2009 10:31 AM In reply to

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

    This issue has been covered several times on the forum. The upshot is that Visual Studio will not deploy the Interop DLL automatically, so you will have to copy it to your device or emulator manually during development. Copy it to the same device folder to which System.Data.SQLite.dll is deployed.

     (Note that when you create an installation CAB for production deployment, the CAB can be configured to install the Interop DLL automatically. It is only Visual Studio's deployment feature which will not do so automatically.)

  • 01-01-2009 11:51 AM In reply to

    • pellelil
    • Top 150 Contributor
    • Joined on 03-04-2008
    • Denmark
    • Posts 9

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

    Thanks manually deploying the DLL to the program folder on the emulated device did the trick.

    Pelle

  • 01-21-2009 6:02 PM In reply to

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

     How do you "manually"deploy the DLL on the emulator? I am working with VS 2005 and using the Windows Mobile 6.0 Professional Emulator.

     I am having the same problem. I tried LoadLibrary("mypath\SQLite.Interop.060.DLL") early in my code, and this did not work...

     I have been wrestling with this for a few days now. I know some of you found a solution. Can you please help?

     Thanks,

    Leo

  • 01-22-2009 2:05 AM In reply to

    • pellelil
    • Top 150 Contributor
    • Joined on 03-04-2008
    • Denmark
    • Posts 9

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

    I simply did it manually, copying the two DLL's ("System.Data.SQLite.DLL" and ""SQLite.Interop.060.DLL") to the same folder on my mobile phone (and/or emulator) as my application was running in. For my physcal mobile phone I simply transfered it with an SD-card, but you can also do it by ActiveSync/MobileDeviceCenter.

     I'm wroking with VS2008, and here you can via the start menu access the menu: "Microsoft 2008" -> "Visual Studio Remote Tools" -> "Remote File Viewer". This program will let you transfere (upload/download) files to/from your emulator device. I read somewhere that these remote tools were moved between VS2005 and VS2008 and apparently there were an easiere access in VS2005 (but I don't know where, perhaps they were accessible directly from within VS !?).

    Pelle

    Filed under: ,
  • 01-22-2009 4:38 AM In reply to

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

     There are several ways to copy the DLL manually to the emulator. All suggested techniques assume that the emulator is already running. Three which come to mind immediately are:

    1. Launch the Device Emulator Manager. You can do this from within VS2005 via "Tools > Device Emulator Manager...". The emulator manager should show your available emulators. Launch the desired emulator if not already running, and then invoke "Actions > Cradle" within Device Emulator Manager. When cradled, as noted in the previous post, ActiveSync (or Vista's Mobile Device Center) should recognize the emulator as an actual mobile device. Set up a guest partnership and then use the appropriate button in ActiveSync / Mobile Device Center to browse or explore and manipulate the device's filesystem directly through normal Windows Explorer. Uncradle the device when done.
    2. Use Microsoft's Remote File Viewer. As noted in the previous post, invoke this from the Start menu via "Visual Studio 2005 > Visual Studio Remote Tools > Remote File Viewer". From the presented list of emulators, select the appropriate one and browse and manipulate its filesystem from within Remote File Viewer. This is more clunky than ActiveSync / Mobile Device Center, but is often a simpler approach since it can be tedious to get everything set up just right for ActiveSync / Mobile Device Center to recognize a cradled emulator (which requires snooping out detailed instructions).
    3. Tell the emulator to mount a folder from your host computer within the emulated environment. From the emulator's menu, "File > Configure...", and then on the "General" tab, enter a path of the host computer (such as "C:\") into the "Shared folder:" field. The folder from the host will now show up in the emulator as a mounted storage card named "\Storage Card". Use the mobile "File Explorer" on the emulator to copy the DLL from the mounted host folder to the appropriate location in the emulated environment. For this last step, you may want to use a more capable program than the crippled built-in File Explorer. There are several options, such as the freeware Total Commander (http://www.ghisler.com/pocketpc.htm).
  • 11-23-2009 1:39 PM In reply to

    • zuppi
    • Not Ranked
    • Joined on 11-23-2009
    • Posts 2

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

    After being close to going crazy with the same issue, I finally found the solution. I posted here to spare others the trouble: In VS use the function 'Add existing item' on project level to include the two DLLs (System.Data.SQLite.dll and SQLite.Interop.060.DLL). For each of them set the property Copy to Output Directory to Copy if newer. Now the Debugging in the Emulator works just as expected.  

    Hope this helps

  • 12-23-2009 11:34 AM In reply to

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

     hello zuppi, a question, I'm programming with the method of 3 layers, and copy the files in all projects and in the emulator, not if I did well in the emulator, but I do not work

  • 01-21-2011 4:24 PM In reply to

    • Naresh
    • Not Ranked
    • Joined on 01-21-2011
    • Posts 1

    Re: Newbie question for CF: "Can't find PInvoke DLL 'SQLite.Interop.060.DLL"

     Hi sunshine,

    Can you please help me with this note you mentioned in the discussion ?

      (Note that when you create an installation CAB for production deployment, the CAB can be configured to install the Interop DLL automatically. It is only Visual Studio's deployment feature which will not do so automatically.) 

     I can run my mobile project on the device by copying the dll to the project folder.

    But I'm getting error for SQLite.Interop.060.DLL with cab installation.

     

    Thanks,

    Naresh

  • 02-12-2011 7:31 AM In reply to

    • wijen
    • Top 500 Contributor
    • Joined on 02-03-2011
    • Posts 5

    Re: "File or assembly name 'System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=1FDB50B1B62B4C84', or one of its dependencies, was not found."

     hello sunshine can u help me solve this kind problem...

Page 1 of 1 (10 items)
Powered by Community Server (Commercial Edition), by Telligent Systems