Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics not working without complain #128

Open
marufbd opened this issue Feb 8, 2012 · 0 comments
Open

Diagnostics not working without complain #128

marufbd opened this issue Feb 8, 2012 · 0 comments

Comments

@marufbd
Copy link

marufbd commented Feb 8, 2012

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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant