System.Data.SQLite 和 Fluent NHibernate - 找不到 IDBCommand
我正在尝试使用 System.Data.SQLite 来使用 Fluent NHibernate 2.12(版本 1.0.74.0,使用 .NET4 x64)。
当尝试创建会话工厂时,出现以下错误(最内部的异常):
程序集中的 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>
并且我的私人探测路径包含正确的文件(已经检查过)
有人知道吗?
I am trying out Fluent NHibernate 2.12 with System.Data.SQLite (ver 1.0.74.0 with .NET4 x64).
When trying to create my session factory I get the following error (innermost exception):
The IDbCommand and IDbConnection implementation in the assembly
System.Data.SQLite could not be found. Ensure that the assembly
System.Data.SQLite is located in the application directory or in the
Global Assembly Cache. If the assembly is in the GAC, use
element in the application configuration file to
specify the full name of the assembly.
Tried what was already suggested
my app.config looks like this:
<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>
and My private probing path contains the correct files (already checked that)
anyone has a clue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近刚刚使用 SQLite 设置了 Fluent nhibernate 进行单元测试,所以这里有一些我可以给你的提示。
如果您使用 Visual Studio 2010 进行调试,您将需要使用 SQLite 32 位。当您尝试包含 64 位程序集时,有一个已知错误应该包含在 Visual Studio 的下一版本中。
除此之外,我可能建议您确保已在 Web 配置中包含以下条目。
PS 找到了该错误的参考
http://connect.microsoft.com/VisualStudio/feedback/details/556670/could-not-load-file-or- assembly-error-when-referencing-a-64-bit- assembly < /a>
I just recently set up fluent nhibernate with SQLite for unit tests so here are some tips I can give you.
If you are debugging with Visual Studio 2010 you will need to use SQLite 32 bit sadly. There is a known bug that should be included with the next release of visual studio when you try to include 64 bit assemblies.
Other than that might I suggest you make sure you have included the following entries in your web config.
PS found a reference to the bug
http://connect.microsoft.com/VisualStudio/feedback/details/556670/could-not-load-file-or-assembly-error-when-referencing-a-64-bit-assembly