无法加载代理工厂工厂异常 [英] Unable to load proxy factory factory exception

查看:154
本文介绍了无法加载代理工厂工厂异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行我的Nhibernate项目时遇到此烦人的错误.它运行得很好,突然间它开始在此路径"d:\ CSharp \ NH \ NH \ nhibernate \ src \ NHibernate \ Bytecode \ AbstractBytecodeProvider.cs"中请求文件,并且在取消时,抛出异常它说 配置代理工厂类期间无法加载类型"NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle". 可能的原因是: -未部署NHibernate.Bytecode提供程序程序集. -用于初始化session-factory部分的'proxyfactory.factory_class'属性的typeName格式不正确.

I am having this annoying error while running my Nhibernate project. It was running okey and all of a sudden it just start asking for a file in this path "d:\CSharp\NH\NH\nhibernate\src\NHibernate\Bytecode\AbstractBytecodeProvider.cs" and when cancel, it throws an exception saying it says Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed.

解决方案: 确认您的部署文件夹包含以下程序集之一: NHibernate.ByteCode.LinFu.dll NHibernate.ByteCode.Castle.dll

Solution: Confirm that your deployment folder contains one of the following assemblies: NHibernate.ByteCode.LinFu.dll NHibernate.ByteCode.Castle.dll

这让我感到沮丧...请帮助-:)

It is become frustrating for me... need help please -:)

推荐答案

确保已将以下dll复制到输出文件夹并

Make sure that you have following dlls copied to the output folder and loaded by your process:

  • NHibernate.ByteCode.Castle.dll
  • Castle.Core.dll
  • NHibernate.dll
  • Iesi.Collections.dll
  • log4net.dll
  • NHibernate.ByteCode.Castle.dll
  • Castle.Core.dll
  • NHibernate.dll
  • Iesi.Collections.dll
  • log4net.dll

您的NHibernate配置包含以下行:

And your NHibernate configuration has this line:

<property name="proxyfactory.factory_class">
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
</property>

作为一个选择,您可以尝试升级到最新版本的NHibernate-3.2.它们具有内置的代理生成器,因此对您来说应该更简单.您将不需要这些其他dll.如果您使用NHibernate 3.2,只需删除上面的配置行即可.

As an option, you can try to upgrade to latest version of NHibernate - 3.2. They have a built in proxy generator so it should be simpler for you. You will not need these additional dlls. Just remove the config line above if you use NHibernate 3.2.

如果由于某些原因您不能升级到3.2,则可以考虑使用其他字节码提供程序. NHibernate开箱即用地支持其中的3个.尝试使用LinFu或Spring:

If for some reasons you can not upgrade to 3.2 you may consider using different byte code providers. NHibernate supports 3 of them out of the box. Try LinFu or Spring:

  • NHibernate.ByteCode.Castle.ProxyFactoryFactory
  • NHibernate.ByteCode.LinFu.ProxyFactoryFactory
  • NHibernate.ByteCode.Spring.ProxyFactoryFactor

这篇关于无法加载代理工厂工厂异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆