我試圖在 Visual Studio 的控制臺中顯示 SQL,但它不起作用。我使用流利的 nhibernate 和以下代碼:string connectionString = WebCondStaClara.Lib.ConfigDB.StringConexao;ISessionFactory sessionFactory = Fluently.Configure() .Database( MySQLConfiguration.Standard.ConnectionString(connectionString).ShowSql ) .Mappings(m => m.FluentMappings .AddFromAssemblyOf<Person>() .AddFromAssemblyOf<Home>() ) .ExposeConfiguration(cfg => new SchemaExport(cfg) .Create(true, false)).BuildSessionFactory();return sessionFactory.OpenSession();我究竟做錯了什么?
1 回答
德瑪西亞99
TA貢獻1770條經驗 獲得超3個贊
(Fluent)NHibernate 使用 log4net 提供日志記錄支持。您必須適當地配置 log4net(使用控制臺、調試或跟蹤附加程序構建配置,并讓記錄器使用這些附加程序)。
- 1 回答
- 0 關注
- 117 瀏覽
添加回答
舉報
0/150
提交
取消
