Dưới đây là đoạn code mà làm tăng ngoại lệKhông thể tạo tài xế từ NHibernate.Driver.SQLite20Driver
public Configuration GetConfiguration()
{
var persister = SQLiteConfiguration
.Standard
.UsingFile("Test.db")
.ShowSql();
var configuration = Fluently
.Configure()
.Database(persister)
.Mappings(map => map.FluentMappings.AddFromAssemblyOf<WordMap>())
.BuildConfiguration();
new SchemaExport(configuration).Execute(true, true, false);
return configuration;
}
Ngoại lệ văn bản đầy đủ:
thất bại: NHibernate.HibernateException: Không thể tạo tài xế từ NHibernate.Driver.SQLite20Driver, NHibernate, Phiên bản = 2.1.2.4000, Văn hóa = trung lập, PublicKeyToken = aa95f207798dfdb4.
----> System.Reflection.TargetInvocationException: Ngoại lệ đã được ném bởi mục tiêu của lời gọi.
----> NHibernate.HibernateException: Việc triển khai IDbCommand và IDbConnection trong assembly.Data.SQLite có thể không tìm thấy. Đảm bảo rằng System.Data.SQLite lắp ráp có vị trí trong thư mục ứng dụng hoặc trong Bộ đệm ẩn toàn cục. Nếu lắp ráp nằm trong GAC, hãy sử dụng phần tử trong tệp cấu hình ứng dụng để chỉ định tên đầy đủ của cụm .
Phiên bản của NHibernate là 2.1.2.4000
Phiên bản System.Data.SQLite là 1.0.66.0
Target Framework là 3.5 (x86)
bản sao địa phương cho System.Data.SQLite là ON.
Điều gì có thể sai?
bạn đã thấy http://stackoverflow.com/questions/845490/fluentnhibernate-and-sqlite http://stackoverflow.com/questions/1460045/sql-data-sqllite-version-with-nhibernate-2-1 http: // stackoverflow.com/questions/1041271/how-to-configure-sqlite-to-run-với-nhibernate-where-assembly-resolves-system-dat –