【问题标题】:SQLite Entity Framework Azure App sqlite3_blob_open does not have an implementationSQLite 实体框架 Azure 应用 sqlite3_blob_open 没有实现
【发布时间】:2018-10-20 13:50:35
【问题描述】:

TLDR;从 SQLite 读取时出现错误 数据库部署到 Azure webb 应用。在本地运行良好..

TypeLoadException:类型中的方法“sqlite3_blob_open” 来自程序集的“SQLitePCL.SQLite3Provider_e_sqlite3” 'SQLitePCLRaw.provider.e_sqlite3,版本=1.0.0.0,文化=中性, PublicKeyToken=9c301db686d0bd12' 没有实现。

我使用以下技术

  • EntityFrameworkCore 的 SQLite
  • Asp.Net Core
  • Azure Web 应用,免费服务计划
  • 在 Visual Studio 2017 中从 React.js 模板创建的项目

它在本地工作,但是当我将它部署到 Azure Web 应用程序时,尝试从数据库中读取数据时出现以下错误。

在我的 startup.cs 中,我有以下内容

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; }
}

我的SQLite数据库文件“appDatabase.db”直接放在startup.cs旁边的web项目文件夹中

【问题讨论】:

    标签: sqlite asp.net-core entity-framework-core azure-web-app-service


    【解决方案1】:

    在添加另一个名为 SQLitePCLRaw.bundle_e_sqlite3

    的 nuget 包后,该问题已得到解决

    https://github.com/ericsink/SQLitePCL.raw

    我发现这个线程 https://github.com/praeclarum/sqlite-net/issues/567 提到了某种捆绑包,所以我搜索了 nuget 并找到了这个。

    【讨论】:

      猜你喜欢
      • 2015-11-26
      • 2013-04-13
      • 2010-10-30
      • 1970-01-01
      • 2014-07-28
      • 2013-12-26
      • 1970-01-01
      • 1970-01-01
      • 2011-09-07
      相关资源
      最近更新 更多