- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 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 提供程序的好处。
提前致谢。
最佳答案
关于c# - NHibernate 3 Alpha - proxyfactory.factory_class?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3695308/
在我的 hibernate.cfg.xml 文件中,其中一个属性是 - org.hibernate.transaction.JDBCTransactionFactory 其他属性很容易理解。
我正在尝试使用 NHibernate 3 alpha,但很难设置我的 SessionFactory。 我有以下内容: var config = new Configuration().Configu
我正在使用 memcache 作为 Hibernate 的二级缓存。我正在使用 hibernate-memcached-1.2.4、spymemcached 2.8.0 和 hibernate 4.1
我是一名优秀的程序员,十分优秀!