I am working on an ASP.net application. Everything is working fine on my development machine. However, when I move the site from the development machine to a testing machine I get the following exception:
[InstantiationException: Object class Management.Utilities.Importer must declare a default (no-arg) constructorNHibernate.InstantiationException]
NHibernate.Util.ReflectHelper.GetDefaultConstructor(Type type) +141
NHibernate.Persister.AbstractEntityPersister..ctor(PersistentClass model, ISessionFactoryImplementor factory) +655
NHibernate.Persister.EntityPersister..ctor(PersistentClass model, ISessionFactoryImplementor factory) +252
NHibernate.Persister.PersisterFactory.Create(PersistentClass model, ISessionFactoryImplementor factory) +59
NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IDictionary properties, IInterceptor interceptor, Settings settings) +820
NHibernate.Cfg.Configuration.BuildSessionFactory() +93
DataManager.NHibernateTransactionManager..cctor()
I'm using NHibernate version 0.6 and am getting this exception whenever I first try loading a first page which would create the SessionFactory. I have double and triple checked that there is a no-arg public constructor on this class and there is (although that wouldn't explain it working on my local machine if there weren't).
Is there any special configuration that I may be missing in IIS (6.0 on Windows Server 2003)?
The exception occurs after the following code:
_configuration = new NHibernate.Cfg.Configuration();
_configuration.AddAssembly("MyAssemblyName");
_factory = _configuration.BuildSessionFactory();
|