NHibernate SchemaExport and Configure() catch-22

佐手、 提交于 2019-11-30 15:46:40

Can you post your configuration file?

I use this method all the time with no tables present, and am able to generate the schema on the fly. My guess is that you may have something off in one of your .hbm files. Try cutting your schema down to 1 table, getting it to work, then building it up from there. As a reference, here is the code I use to generate the db schema:

    var cfg = new Configuration();
    cfg.Configure();
    var schema = new SchemaExport(cfg);
    schema.Create(true, true);

This will also push the script to the console for you, so you can see what SQL is generated against the db.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!