TLDR; I'm getting an error when reading from SQLite database deployed to Azure webb app. Works fine locally..
TypeLoadException: Method 'sqlite3_blob_open' in type 'SQLitePCL.SQLite3Provider_e_sqlite3' from assembly 'SQLitePCLRaw.provider.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c301db686d0bd12' does not have an implementation.
I use the following technologies

It works locally but when I deploy it to the Azure web app I get the following error when trying to read data from the database.

In my startup.cs I have the following
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddDbContext<AppDbContext>(options => options.UseSqlite(@"Data Source=appDatabase.db"));
}
AppDbContext.cs
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options)
: base(options)
{ }
public DbSet<Persons> Persons { get; set; }
}
My SQLite database file "appDatabase.db" is placed directly in the web projects folder next to the startup.cs

The issue was fixed after adding another nuget package called SQLitePCLRaw.bundle_e_sqlite3
https://github.com/ericsink/SQLitePCL.raw

I found this thread https://github.com/praeclarum/sqlite-net/issues/567 that mentioned some sort of bundle package so I searched nuget and found this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With