【发布时间】:2010-07-04 14:28:51
【问题描述】:
我在让 nhibernate 与 sqlite 一起玩时遇到问题:
我的 NHibernate 配置:
<NHibernate>
<hibernate xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.driver_class">NHibernate.Driver.SQLite20Driver</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">Data Source=test.db;New=True;</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.SQLiteDialect</property>
<property name="use_outer_join">true</property>
<property name="show_sql">false</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
<mapping assembly="SimpleGallery" />
</session-factory>
</hibernate>
</NHibernate>
我在 Windows 7 64 位上运行。我尝试将 x86 和 64 位版本的 system.data.sqlite.dll 复制到输出目录以及引用它们并将它们设置为复制本地但无济于事。 VS 解决方案已设置为编译为 any/x86/64bit,但我仍然收到异常:
"{"在程序集 System.Data.SQLite 中找不到 IDbCommand 和 IDbConnection 实现。确保程序集 System.Data.SQLite 位于应用程序目录或全局程序集缓存中。如果程序集在 GAC 中,请使用应用程序配置文件中的元素来指定程序集的全名。"}"
我错过了什么?
【问题讨论】:
-
不知道有没有用,不过你可以试试下载锐架构项目,里面配置了sql lite。
标签: nhibernate sqlite