无法在 NHibernate 中加载文件或程序集 [英] Could not load file or assembly in NHibernate
问题描述
我最近在 hibernate.cfg.xml
文件中遇到了一些问题,因为我没有输入以下行.
I recently had some problems with the hibernate.cfg.xml
file as I hadn't had the following line in.
<property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
现在这个问题已经解决了,我收到了以下错误.
Now that this is fixed I get the following error.
无法加载文件或程序集NHibernate,版本=2.1.0.4000,文化=中性,PublicKeyToken=aa95f207798dfdb4"或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(来自 HRESULT 的异常:0x80131040)
Could not load file or assembly 'NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
为什么会出现此错误以及如何解决?
Why do I get this error and how do I fix it?
推荐答案
这些文件应该与引用的文件 NHibernate.dll 位于同一目录中:
These files should be in the same directory as the referenced file, NHibernate.dll:
Antlr3.Runtime.dll
Iesi.Collections.dll
log4net.dll
Castle.Core.dll
Castle.DynamicProxy2.dll
你也应该添加一个参考或复制这个:
Also you should add a reference or copy this one too:
- NHibernate.ByteCode.Castle.dll
这篇关于无法在 NHibernate 中加载文件或程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!