我正在尝试使用System.Data.SQLite的Fluent NHibernate 2.12(带有.NET4 x64的ver 1.0.74.0)。
在尝试创建会话工厂时,我收到以下错误(最内层异常):
程序集中的IDbCommand和IDbConnection实现 找不到System.Data.SQLite。确保装配 System.Data.SQLite位于应用程序目录或中 全局程序集缓存。如果程序集在GAC中,请使用 应用程序配置文件中的元素 指定程序集的全名。
尝试了已经提出的建议 我的app.config看起来像这样:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
<probing privatePath="Lib\NHibernate;Lib\Castle;Lib\SQLite"></probing>
<qualifyAssembly
partialName="System.Data.SQLite"
fullName="System.Data.SQLite, Version=1.0.74.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
</assemblyBinding>
</runtime>
</configuration>
和我的私人探测路径包含正确的文件(已经检查过)
谁有线索?
答案 0 :(得分:0)
我最近刚用SQLite设置了流畅的nhibernate进行单元测试,所以这里有一些我可以给你的提示。 如果使用Visual Studio 2010进行调试,则需要遗憾地使用SQLite 32位。当您尝试包含64位程序集时,Visual Studio的下一版本中应包含一个已知错误。 除此之外,我建议您确保在Web配置中包含以下条目。
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
PS找到了对bug的引用
http://connect.microsoft.com/VisualStudio/feedback/details/556670/could-not-load-file-or-assembly-error-when-referencing-a-64-bit-assembly