Nhibernate使用中遇到的问题
2013-01-25 10:54
183 查看
错误信息:
Hibernate.ByteCode.Castle.dll —> System.IO.FileLoadException: Could not load file or assembly ‘NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4′ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.
这是Nhibernate3.2以后,nh提供了自己的proxy, 自己的bytecode,不需要引用 Hibernate.ByteCode.Castle.dll, 跟 Castle.Core.dll 了。
新的 proxyfactory.factory_class 的设置方法:
<property name=”proxyfactory.factory_class”>NHibernate.Bytecode.DefaultProxyFactoryFactory, NHibernate</property>
按教程配出来了hbm.xml, 写出Entity类,配好数据库的连接,Run一下,一直报
Unable to locate persister for the entity named
后来终于发现是hibernate.cfg.xml中未加上这一行
<mapping assembly="nhibernateSample" />
郁闷啊,这个是从nhibernate的目录中拷过来的啊,教程中也完全没有提到这回事。。。。
Hibernate.ByteCode.Castle.dll —> System.IO.FileLoadException: Could not load file or assembly ‘NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4′ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.
这是Nhibernate3.2以后,nh提供了自己的proxy, 自己的bytecode,不需要引用 Hibernate.ByteCode.Castle.dll, 跟 Castle.Core.dll 了。
新的 proxyfactory.factory_class 的设置方法:
<property name=”proxyfactory.factory_class”>NHibernate.Bytecode.DefaultProxyFactoryFactory, NHibernate</property>
按教程配出来了hbm.xml, 写出Entity类,配好数据库的连接,Run一下,一直报
Unable to locate persister for the entity named
后来终于发现是hibernate.cfg.xml中未加上这一行
<mapping assembly="nhibernateSample" />
郁闷啊,这个是从nhibernate的目录中拷过来的啊,教程中也完全没有提到这回事。。。。
相关文章推荐
- [项目过程中所遇到的各种问题记录]ORM篇——使用NHibernate配置对象实体的一些小问题
- [项目过程中所遇到的各种问题记录]ORM篇——使用NHibernate配置对象实体的一些小问题 22
- 在nhibernate使用过程中遇到的几个问题。
- [项目过程中所遇到的各种问题记录]ORM篇——使用NHibernate配置对象实体的一些小问题
- 我使用NHibernate在.NET中遇到的问题一记!
- 初次使用NHibernate遇到的问题
- 在nhibernate使用过程中遇到的几个问题02
- 多GPU环境下使用caffe遇到的问题
- 安卓极光推送的使用以及可能遇到的问题整理
- 安装和使用安卓iGO遇到的问题及解决方法
- Cocoapods的使用以及遇到的问题
- 项目实现过程中遇到的问题记录(二)------------在Thread中使用CallBack并没有调用CallBack的返回
- spring mvc使用过程中关于spring:bind和绑定java.util.Date遇到的问题
- 使用JDBC遇到SQL关键字in的问题
- NetDiskdll.dll中MD5File函数使用时遇到的问题
- cocoapods安装、安装中可能遇到问题以及使用
- 使用postman发送post数据时遇到的问题
- 使用VS2010开发时遇到的新问题
- pulseaudio使用过程中遇到的问题
- 远程登录 - telnet、mstsc等工具的使用及遇到的问题