Forum Xamarin.Forms

How can i use SQLite in my Shared Library?

C64GamerC64Gamer USMember ✭✭


i want to use SQLite in my shared library cross platform project. Adding it in Xamarin.Android or Xamarin.iOS is not really the problem. I don't want to write the same database code twice. Is there a way to write a dataManager for sqllite in the shared libs?


Best Answer


  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @WFLNorman - Xamarin have an example of SQLite from a SharedProject here:

  • C64GamerC64Gamer USMember ✭✭

    Thx. :-) I will try my luck.

  • C64GamerC64Gamer USMember ✭✭

    I have implemented the SQLite.cs from the linked github page and did all steps from the tutorial for shared librarys.
    When i try to compile my project i get the following error:

    Line 1018 in SQLite.cs: Thread.VolatileWrite (ref _transactionDepth, depth);
    The name 'Thread' does not exist in the current context.

  • rizwanrizwan INMember


    I am getting the same errors 66 in number as the one you got, when I added Sqlite-net Package in the shared project of xamarin.
    Were you abel to solve this issue ? How ?


Sign In or Register to comment.