运行最新版本的nhibernate时遇到问题

时间:2009-06-22 21:21:38

标签: nhibernate

我下载了最新版本的NHibernate“2.1.0.2002”。

它构建得很好,但是当我运行单元测试时,我不断收到错误: -

  

System.IO.FileLoadException:无法加载文件或程序集'NHibernate,Version = 2.0.1.4000,Culture = neutral,PublicKeyToken = aa95f207798dfdb4'或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。

它看起来像旧版本。

这是链接

https://stackoverflow.com/questions/839112/problem-while-migrating-nhibernate-to-higher-version

这是我得到的内部错误:

=== Pre-bind state information ===
LOG: DisplayName = NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
 (Fully-specified)
LOG: Appbase = file:///D:/Project Files/CIS3G/Webapp/_Test_DAL/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : CIS3G.DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Project Files\CIS3G\Webapp\_Test_DAL\bin\Debug\_Test_DAL.dll.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
LOG: Attempting download of new URL file:///D:/Project Files/CIS3G/Webapp/_Test_DAL/bin/Debug/NHibernate.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

2 个答案:

答案 0 :(得分:1)

请检查您是否将NHibernate参考中的特定版本属性设置为“true”?这个错误似乎并非如此,但是对于新的NHibernate,你需要提供像Linfu.dll这样的外部ByteCodeProvider。请检查一下。

答案 1 :(得分:1)

我之前遇到过这个问题。

就我而言,问题在于我使用UnitOfWork实现来处理Nhibernate sessionFactories

我一直在使用这个lib一段时间,所以我只是将已编译的dll复制到新版本的NHibernate的新测试项目中,所以我遇到了版本问题。

相关问题