I am using Fluent NHibernate with an external 'hibernate.cfg.xml' file. by machine name like this "Environment.MachineName + ".cfg.xml""
Following is the configuration code where I am getting error:
public static bool BuildSessionFactory()
{
if (_sessionFactory != null) return false;
var configuration = new NHibernate.Cfg.Configuration();
configuration.Configure(Environment.MachineName + ".cfg.xml");
configuration.AddAssembly(System.Reflection.Assembly.GetExecutingAssembly());
_sessionFactory = Fluently.Configure(configuration)
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<NHibernateHelper>())
.BuildSessionFactory();
return true;
}
But When NHibernate is trying to configure, I am getting floowing error:
exception says:
FluentNHibernate.Cfg.FluentConfigurationException was unhandled
Message: An unhandled exception of type 'FluentNHibernate.Cfg.FluentConfigurationException' occurred in FluentNHibernate.dll
Additional information: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.