在ABP中使用SQLite
使用ABP连接SQLite时出现下面错误:
System.Data.Entity.Core.EntityException:“The underlying provider failed on Open.”
内部异常
ArgumentException: isolationLevel
找了好久才解决,记录一下。
1. 在Web和Ef项目中添加SQLite包

2.修改Web项目中的Web.config文件

添加 invariantName="System.Data.SQLite",type同invariantName="System.Data.SQLite.EF6"
数据库连接格式 <add name="Default" providerName="System.Data.SQLite.EF6" connectionString="Data Source=|DataDirectory|XXX.db;Pooling=True" />
3.修改Ef项目中事务隔离级别
未修改前报错:

修改如下:

主要是下面代码:
Configuration.UnitOfWork.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;

浙公网安备 33010602011771号