NHibernate 忽略 proxyfactory 属性
我从 NH 2.1 / Fluent 1.1 升级到 NH 3.1 / Fluent 1.2。我使用 LinFu 作为代理,但是升级后,无论我配置什么,NH 都会尝试加载 Castle。 我使用 Fluent 设置,
Configuration _Configuration;
FluentConfiguration _FluentConfig;
_Configuration = new Configuration();
_Configuration.Configure();
_FluentConfig = Fluently.Configure(_Configuration)
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<FluentNHSession>()))
nhibernate.cfg 也配置为使用 linfu:
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
运行应用程序时,会引发异常,表示找不到 castle dll。使用相同的 nhibernate.cfg 但将 castle ddl 放在 bin 目录中工作正常,似乎 NH 忽略了配置。
I upgraded from NH 2.1 / Fluent 1.1 to NH 3.1 / Fluent 1.2. I was using LinFu as proxy, however after the upgrade no matter what I configure NH tries to load Castle.
Im setting Fluent using
Configuration _Configuration;
FluentConfiguration _FluentConfig;
_Configuration = new Configuration();
_Configuration.Configure();
_FluentConfig = Fluently.Configure(_Configuration)
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<FluentNHSession>()))
Also nhibernate.cfg is configured to use linfu:
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
When running the application an exception is raised saying it cant find castle dll's. Using the same nhibernate.cfg but dropping castle ddl's in the bin directory works fine, seems like NH ignores the configuration.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有同样的问题。我通过将这一行包含在我的流畅配置中解决了这个问题。
如果此答案或此处的任何其他答案对您有帮助,请单击复选标记将其标记为答案。
I had the same problem. I solved it by including this line in my fluent configuration.
If this answer or any other answers here help you please mark it as the answer by clicking the check mark.