【发布时间】: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