在dotnet当中使用sqlite数据库遇到的问题

如果不引入SQLitePCLRaw.bundle_e_sqlite3包,则在创建连接的时候会出现System.Exception:“You need to call SQLitePCL.raw.SetProvider(). If you are using a bundle package, this is done by calling SQLitePCL.Batteries.Init().”相关异常

解决方案

有两种解决方案

  1. 第一种解决方案是引入上述包
  2. 第二种解决方案是不要使用Microsoft.Data.Sqlite.Core包,而要使用不带Core后缀的包,后者包含了上述依赖,前者未包含