Having trouble adding a downloaded .dll to my project RRS feed

  • Question

  • I have downloaded sqlite3.dll from the sqlite site. However when I try to add it to my project I get an error, "A reference to 'filepath' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."

    Any help on how I can add this .dll to my project?

    Friday, December 14, 2018 9:13 PM

All replies

  • Sqlite.dll is a C DLL, not a COM component or a C# assembly.  In order to use that file, you would need to use p/invoke, which is ugly.

    There are several third-party libraries that provide a C# interface to SQLite, such as System.Data.SQLite.  That's what you need.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Proposed as answer by Cherkaoui.Mouad Saturday, December 15, 2018 1:42 AM
    Friday, December 14, 2018 9:36 PM
  • Hi, thankyou for your answer. The System.Data.SQLite website only mentions C++, there is no mention of C#.
    Saturday, December 15, 2018 9:30 AM
  • System.Data.SQLite required for SQLite, you can get from nuget. Nuget package manager installs all dependencies and then build the project. First build important because SQLite required folder (x84 and x64) and files creates. That is all, you can keep going programming.

    TR| Sorunuzun yanıtı bu ise "Yanıt Olarak Öner" olarak işaretleyin, eğer faydalı bir yorum ise "Oy Ver"erek forumun işleyişine katkıda bulunabilirsiniz. EN| If this is the answer to your problem, mark "Propose as Answer" and if it is helpful, you can contribute to the workig of the forum by "Voting".

    Saturday, December 15, 2018 10:23 AM
  • Hi Ebstenstor,

    Thank you for posting here.

    Or you could use DllImport to call the functions in sqlite3.dll.

    Please check the link below.


    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 17, 2018 7:36 AM
  • It is a .NET component.  It will work with any .NET language, C#, VB, C++/CLI, F#, etc.  That is its purpose.  The component might be WRITTEN in C++, but it was designed to allow .NET apps to access SQLite.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, December 17, 2018 7:33 PM