升级到VS2010和Re#5后,与SQLite相关的nUnit-tests问题

sti*_*k81 4 sqlite nhibernate resharper nunit visual-studio-2010

使用ReSharper5转换为Visual Studio 2010后,我的一些单元测试开始失败.更具体地说,这适用于将NHibernate与SQLite一起使用的所有单元测试.这个问题似乎与SQLite有某种关系.不涉及NHibernate和SQLite的单元测试仍然正常运行.

例外情况如下:

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 <qualifyAssembly/> element 
       in the application configuration file to specify the full name of the assembly.
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Run Code Online (Sandbox Code Playgroud)

清理未成功创建的NHibernate对象时,TearDown上的NullReferenceException异常,但问题似乎与SQLite有关.

我通过ReSharper运行我的单元测试,但是直接通过NUnit.exe应用程序运行它时会得到相同的异常.但是,通过x86变体(NUnit-x86.exe)运行它们所有测试运行正常.它可能与64位和32位dll的某些混合有关吗?它仍然通过VS2008 + ReSharper4.5运行良好.

请注意,我的项目的目标框架仍然是.NET3.5.

以前有人见过这个问题吗?

sti*_*k81 6

似乎在某种程度上64位和32位dll之间存在混淆.切换到使用SQLite.dll的x64变体可以解决问题.我不确定为什么VS2008不会出现这个问题.