1

我已将 NHibernate 配置为将它生成的 SQL 输出到控制台。我已将以下内容添加到包含我想从 NUnit 运行的集成测试的 DLL 的 app.config 中:

  <configSections>
    <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <nhibernate>
    <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
    <add key="hibernate.show_sql" value="true" />
  </nhibernate>

但是,SQL 仍然没有输出到 Console.Out。谁能想到我可能需要设置的另一个设置来查看我的 NHibernate 查询产生的 SQL?

4

1 回答 1

4

您是否尝试使用单独的 xml 配置?http://nhibernate.info/doc/howto/various/configure-log4net-for-use-with-nhibernate.html

于 2010-10-11T11:09:23.743 回答