gpt4 book ai didi

c# - NHibernate 3 Alpha - proxyfactory.factory_class?

转载 作者:行者123 更新时间:2023-11-30 18:07:53 26 4
gpt4 key购买 nike

我正在尝试使用 NHibernate 3 alpha,但很难设置我的 SessionFactory。

我有以下内容:

 var config = new Configuration().Configure();
_sessionFactory = config.BuildSessionFactory();

但是,在 3 alpha 下载提供的 dll 中,没有提供代理工厂类。即NHibernate.ByteCode.CaSTLe、NHibernate.ByteCode.LinFu,以及nHib 2.x自带的Spring,这里就不提供了。

所以在 3 alpha 包中,我查看了 NHibernate.Example.Web 并使用了它提供的 NHibernate.ByteCode.LinFu;此示例在其 config.hbm 中使用它。

所以,我的 hibernate.cfg.xml 有

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

创建工厂时上述代码的第二行失败

NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException was unhandled by user code Message=Unable to load type 'NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu' 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

但是,LinFu ref 被设置为 CopyLocal,并且深入研究堆栈跟踪得到:

at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) InnerException: System.IO.FileLoadException
Message=Could not load file or assembly 'NHibernate, Version=3.0.0.1002, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Source=mscorlib FileName=NHibernate, Version=3.0.0.1002, Culture=neutral, PublicKeyToken=null FusionLog==== Pre-bind state information ===

LOG: DisplayName = NHibernate, Version=3.0.0.1002, Culture=neutral, PublicKeyToken=null (Fully-specified)
LOG: Appbase = file:///C:/Dev/SilverTracker/src/SilverTracker/SilverTracker.Web.Services/
LOG: Initial PrivatePath = >C:\Dev\SilverTracker\src\SilverTracker\SilverTracker.Web.Services\bin
Calling assembly : NHibernate.ByteCode.LinFu, Version=3.0.0.1002, Culture=neutral, PublicKeyToken=null.

以及内部执行本身:

{"Could not load file or assembly 'NHibernate, Version=3.0.0.1002, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"NHibernate, Version=3.0.0.1002, Culture=neutral, PublicKeyToken=null"}

据我所知,它找到了文件,但它与 nHib 3 程序集不兼容。

所以,我有点不知所措!

3 的配置有变化吗?除了 3 个程序集提供的示例之外,我正在努力寻找任何其他示例。

这是一个 .NET 4.0 WCF 服务。我知道我可以只使用 2.x,但我正在尝试新的 linq 提供程序的好处。

提前致谢。

最佳答案

如果我不是这么笨的话,我会发布一个更新的版本 (alpha 2),其中包含您所期望的一切。

取自这里: link text

一切都很好,我会把它留在这里以防其他人遇到同样的问题。

关于c# - NHibernate 3 Alpha - proxyfactory.factory_class?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3695308/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com