DS2020
DS2020

Reputation: 279

updating fluent nhibernate to 1.4 and nhibernate to 3.3.1 gives error with nhibernate.bytecode.castle

updating fluent nhibernate to 1.4 and nhibernate to 3.3.1 gives error with nhibernate.bytecode.castle

configuring session factory:

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();

Need to use proxyfacotry? what is the new way to do so ? thanks in advance

Upvotes: 1

Views: 163

Answers (1)

Fran
Fran

Reputation: 6520

Castle is the default proxy for NHibernate. You don't need to specify it in the configuration starting with NHibernate 3. Just remove the line.

Upvotes: 2

Related Questions