将流畅的nhibernate更新为1.4并将nhibernate更新为3.3.1会导致nhibernate.bytecode.castle
错误
配置会话工厂:
Configuration configuration = new Configuration();
configuration
.CurrentSessionContext<TCurrentSessionContext>()
.Configure()
.Proxy(p => p.ProxyFactoryFactory<ProxyFactoryFactory>());
// Taken from the SharpArch.Data.NHibernate.NHibernateSession
_sessionFactory = Fluently.Configure(configuration)
.Mappings(m =>
{
foreach (var mappingAssembly in mappingAssemblies)
{
var assembly = Assembly.LoadFrom(MakeLoadReadyAssemblyName(mappingAssembly));
m.FluentMappings.AddFromAssembly(assembly);
}
if (autoPersistenceModel != null)
{
m.AutoMappings.Add(autoPersistenceModel);
}
})
.BuildSessionFactory();
需要使用proxyfacotry
吗?这样做的新方法是什么?
提前谢谢
答案 0 :(得分:2)
Castle是NHibernate的默认代理。您不需要在以NHibernate 3开头的配置中指定它。只需删除该行。