我为一个新项目安装了 NuGet 包 NHibernate 和 Castle.Core 3.0.通常我们手动复制dll;这是我第一次使用 NuGet.
现在我找不到如何配置 ProxyFactoryFactory,或者说,我找不到它.我在项目中引用了 NHibernate 和 Castle.Core(我可以在 Castle.Core 包中找到的唯一 dll),并配置了以下内容:
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle</属性>这导致:
类初始化方法Tests.UnitTest1.MyClassInitialize 抛出异常.NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException:NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException:无法加载类型'NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle' 在代理工厂类的配置期间.显然这个 dll 丢失了,但我在哪里可以找到呢?NuGet 中有一个名为 Castle.DynamicProxy 的包,但它被标记为已过时.
p.s.:Castle.Core 3.0 - 包的描述中说:...包括DynamicProxy ...
解决方案NHibernate 的最新版本不需要配置代理工厂.
默认使用内部适配器,旧适配器不再是项目的一部分.
I installed with NuGet the packages NHibernate and Castle.Core 3.0 for a new project. Usually we copied around the dlls manually; it is the first time I do that with NuGet.
Now I can't find out how to configure the ProxyFactoryFactory, or let's say, I can't find it. I referenced NHibernate and Castle.Core (the only dll I could find in the Castle.Core - package) within the project, and configured the following:
<property name="proxyfactory.factory_class"> NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle </property>This leads to:
Class Initialization method Tests.UnitTest1.MyClassInitialize threw exception. NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class.
Obviously this dll is missing, but where can I find that? There is a package in NuGet called Castle.DynamicProxy, but it is marked as obsolete.
p.s.: In the description of the Castle.Core 3.0 - package, it is said: ... including DynamicProxy ...
解决方案The last versions of NHibernate do not require configuring a proxy factory.
An internal one is used by default and the old adapters are not part of the project anymore.
更多推荐
NuGet:NHibernate、Castle.Core 3.0 以及 ProxyFactoryFactory 在哪里?
发布评论