in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

Could not load file or assembly...

Last post 05-09-2008 8:01 AM by David. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-08-2008 4:05 PM

    • David
    • Top 500 Contributor
    • Joined on 05-08-2008
    • Posts 2

    Could not load file or assembly...

    I have used SQLite to power a rather simple application, but when my mate wanted to try it out it didn't work. He manages to start the application, but as soon as it attempts to access the database, he recieves the following error message:

    System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.48.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system can't locate the file.

    He has the dll file in the same directory as the executable, so I'm all out of ideas. Does anyone have ideas as to what could be wrong?

    Thanks in advance. D~
  • 05-08-2008 4:46 PM In reply to

    Re: Could not load file or assembly...

    This can happen when you distribute the 32-bit version of the SQLite assembly to a 64-bit OS and your application is compiled for "Any CPU".  It'll attempt to run your app in 64-bit land and will be unable to load the 32-bit SQLite library.

    So either compile for 32-bits, or distribute the right version of the SQLite assembly that matches the target OS.

    Robert

     

  • 05-09-2008 8:01 AM In reply to

    • David
    • Top 500 Contributor
    • Joined on 05-08-2008
    • Posts 2

    Re: Could not load file or assembly...

    Thanks for your reply, I found the solution however. It turns out I renamed the dll-file to "sqlite.dll" before I referenced it, assuming it would work fine that way.

    Thus I have a second question. Is it possible to rename the dll-file to a shorter filename than "system.data.sqlite.dll", and if so, how?

    D~
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems