fluent-nhibernate
fluent-nhibernate copied to clipboard
Diagnostics not working without complain
This code snippet produces the exported hbm without any error, even i can execute the sql prom schemaexport. The only thing that is not working and without any complain is the Diagnostics whereas it should produce output like: https://gist.github.com/592679
I have tried changing the OutputToConsole which should register a listener. And its taking any invalid path to OutputToFile and does not produce any exception. Just not working.
var cfg = new NHibernate.Cfg.Configuration();
//nhibernate config from config file
cfg.Configure(dataConfig.NHibConfigPath);
FluentConfiguration fConfig = Fluently.Configure(cfg)
.Mappings(m =>
{
//get default persistent model generator
var model =
new AutoPersistenceModelGenerator(overrideAssembly)
{AutoMappingAssemblies = autoMappingAssemblies};
if (config.ExportHbm)
{
var hbmExportPath = dataConfig.HbmExportPath;
m.AutoMappings.Add(model.Generate).ExportTo(hbmExportPath);
}
});
//this line does not provide any output
fConfig.Diagnostics(x => x.Enable().OutputToFile("D:/tmp/fluentNHibernate_log.txt"));
Configuration = fConfig.BuildConfiguration();
Factory = Configuration.BuildSessionFactory();