Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlite-net-pcl SqliteAsyncConnection.CreateTableAsync<T> throws System.MissingMethodException

I am trying to create a table using the latest version of sqlite-net-pcl nuget package

var db = new SQLiteAsyncConnection("data.db");
await db.CreateTableAsync<Site>();

The CreateTableAsync call throws the following exception:

System.MissingMethodException: 'Method not found: 'System.String SQLitePCL.raw.sqlite3_column_name(SQLitePCL.sqlite3_stmt, Int32)'.'

Here is the Site class

public class Site
{
    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }

    public String Name;
    public String PriceCssSelector;
    public String URLRegex;

    public Site()
    {
    }
}

I tried downgrading to the latest stable version of sqlite-net-pcl package.

like image 837
JohnWick Avatar asked Sep 01 '19 09:09

JohnWick


1 Answers

In my case the problem was Microsoft.AppCenter and Microsoft.Appcenter.Distribute. Those packages bring in an incompatible SQLite version and downgrading/removing them solved the problem.

like image 53
MariusKoch Avatar answered Oct 07 '22 20:10

MariusKoch