日期:2014-05-20  浏览次数:20656 次

关于NHibernate的问题
刚学习NHibernate,做了一个测试程序,该引用的DLL也都引用了,可是运行时候报下列错误
NHibernate.ByteCode.Castle.ProxyFactoryFactory does not implement NHibernate.Bytecode.IProxyFactoryFactory 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: NHibernate.Bytecode.HibernateByteCodeException: NHibernate.ByteCode.Castle.ProxyFactoryFactory does not implement NHibernate.Bytecode.IProxyFactoryFactory

源错误: 


行 17: {
行 18: 
行 19: _sessionFactory = new Configuration().Configure().BuildSessionFactory();
行 20: }
行 21: 
 

源文件: E:\Test\TestNhibernate\TestNhibernate\NHibernateHelper.cs 行: 19 

配置文件里面写的是
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<!--数据库类型-->
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<!--数据连接提供者-->
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<!--数据库连接字符串-->
<property name="connection.connection_string">
  Server=.;initial catalog=NHibernate;uid=sa;pwd=1q2w3e4r!;
  </property>
<property name="proxyfactory.factory_class">
  NHibernate.ByteCode.Castle.ProxyFactoryFactory,
  NHibernate.ByteCode.Castle
  </property>
<mapping assembly="TestNhibernate"/>
</session-factory>
</hibernate-configuration>

有的人说是“NHibernate.ByteCode.Castle.dll”这个DLL没引用,可是我已经引用了,不知道错在哪里,请高手帮个忙,谢谢了。急~~~~~~~~~在线等

------解决方案--------------------
创建SessionFactory失败了
你应该缺两个引用文件。
NHibernate.ByteCode.Castle.dll
还有一个忘记了。
LZ把所有引用DLL删除后。
然后再重新引用一遍啊!