无法使用 Syste.Data.SQLite.dll x86 运行 mspec.exe,但它可以在 R# MSpec 运行程序中运行
我使用 mspec 进行测试,并在测试中为我的数据库使用 SQLite x86 进行 NHiernate 设置。问题是,当我使用 mspec r# 运行程序运行测试时,一切正常,但从控制台运行它会出现找不到 sqlite dll 的错误。
我的规范项目配置:
.net 4
x86(使用x86版本的sqlite)
System.Data.SQLite,Version=1.0.64.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139 mspec,Version=0.3.0.0,Culture=neutral,PublicKeyToken=null,目标运行时:v4.0.30319,目标:x86
MSpec 是从源代码构建的。在 Reflector 中,mspec.exe 显示为为 x86 构建 - 这似乎适合我的设置,并且如上所述,使用 r# runner 测试运行良好。
NHibernate.HibernateException:无法从 NHibernate.Driver.SQLite20Driver、NHibernate、Version=2.1.2.4000、Culture=neutral、PublicKeyToken=aa95f207798dfdb4 创建驱动程序。 ---> System.Reflection.TargetInitationException:调用目标已引发异常。 ---> NHibernate.HibernateException:无法找到程序集 System.Data.SQLite 中的 IDbCommand 和 IDbConnection 实现。确保程序集 System.Data.SQLite 位于应用程序目录或全局程序集缓存中。如果程序集位于 GAC 中,请使用应用程序配置文件中的 element 指定程序集的全名。 在NHibernate.Driver.ReflectionBasedDriver ..ctor(字符串driverAssemblyName,字符串connectionTypeName,字符串commandTypeName) 在NHibernate.Driver.SQLite20Driver..ctor()
有谁知道如何解决这个问题吗?
预先感谢和来自多云维也纳的问候,
克里斯
I use mspec for my tests and have a NHiernate Setup using SQLite x86 for my database in the tests. The problem is that when i run my test using the mspec r# runner everything works fine but running it from the console thwors an error that it cannot find the sqlite dll.
My config of the specification projects:
.net 4
x86 (using the x86 version of sqlite)
System.Data.SQLite, Version=1.0.64.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
mspec, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null, target runtime: v4.0.30319, target: x86
MSpec is built from source. In Reflector the mspec.exe shows up as built for x86 - which seems right for my setup and as said tests are running fine using r# runner.
NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> NHibernate.HibernateException: 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.
at NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName)
at NHibernate.Driver.SQLite20Driver..ctor()
Has anyone an idea how to fix that?
thanks in advance and greetings from cloudy vienna,
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用fuslogvw.exe我发现了准确的错误(感谢您的提示;):
“拒绝针对 v2.0.50727 构建的 IJW 模块,因为它可以在此过程中加载到另一个运行时中。”
添加 mspec.exe.config 例如:
解决了问题,现在我的测试按预期运行。
谢谢&问候,
克里斯
Using fuslogvw.exe i found the accutal error (thanks for the hint ;):
"Rejecting IJW module built against v2.0.50727 because it could be loaded into another runtime in this process."
Adding a mspec.exe.config like:
solved the issue, now my test runas expected.
thanks & greetings,
chris