首页 \ 问答 \ NHibernate没有将SQL输出到控制台(NHibernate not outputting SQL to console)

NHibernate没有将SQL输出到控制台(NHibernate not outputting SQL to console)

我已配置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吗?


I have configured NHibernate to output the SQL it generates to the console. I have added the following to the app.config of the DLL containing the integration tests I want to run from NUnit:

  <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>

However, the SQL is still not being output to Console.Out. Can anyone think of another setting I might need to set to view the SQL resulting from my NHibernate queries?


原文:https://stackoverflow.com/questions/3905597
更新时间:2022-10-01 18:10

最满意答案

手册页不够用吗?


Is the manual page not sufficient?

相关问答

更多
  • 看起来您的配置文件以UTF-8 BOM( 0xEF 0xBB 0xBF ) 0xEF 0xBB 0xBF 。 删除它应该解决启动器的问题,但可能会导致错误,因为AFAIK .hgrc应该是默认的语言环境字符集(不是UTF-8)。 It looks like your configuration file starts with a UTF-8 BOM (0xEF 0xBB 0xBF). Removing that should fix the problem for starters, but might ...
  • 好的,我自己找到了答案。 此页面提供了有关传递给钩子函数的参数的一些提示: https : //www.mercurial-scm.org/wiki/MercurialApi#Reading_configuration_files ui.config函数允许读取Mercurial配置文件,给出节和属性名称。 Ok I find out the answer by myself. This page gives some hints about the argument passed to the hook ...
  • 定义新值时,不能引用.hgrc其他值。 但是,对于这个特殊情况,你很幸运:像~foo和$USER这样的东西在别名中被扩展。 这意味着您可以像这样定义别名 [alias] ulog = log -u $USER 这不是你要求的,但如果所有用户都在Linux上,它应该可以正常工作。 You cannot refer to other values in the .hgrc when defining a new value. However, for this particular case you're i ...
  • 您在.hgrc上指定的别名是mercurial的内部。 例如: [alias] ng = push -f 你现在可以键入hg ng ,这是一个“内部”别名。 但是,如果你想要一个全局别名(只键入ng而不是hg ng ),那么你必须把它放在.bashrc中(如果已经存在则为.bash_aliases) alias ng="hg push -f" The aliases you specify on .hgrc are internal for mercurial. For example with thi ...
  • 手册页不够用吗? Is the manual page not sufficient?
  • 正如我之前提到的 ,您可以通过以下方式修改您为该回购服务的方式: hg serve --config web.push_ssl=No --config "web.allow_push=*" hgrc通常在你的家里: ~/.hgrc 。 请参阅“ 发布Mercurial存储库的配置文件位置 ”: hgweb读取像Mercurial那样的全局和特定于存储库的配置文件 - 请参阅hg help config 。 请注意,它将读取Web服务器运行的用户的.hgrc。 如hg help config ,您拥有本地, ...
  • 来自hgrc的auth部分: format: . = 其中用于将参数分组到认证条目中。 .prefix :使用匹配前缀最长的认证条目 因此,code.google.com的单个条目就足够了。 同样感兴趣的是%include file因此您可以将常见事物存储在单独的文件中并将它们包含在任何hgrc中。 from auth section in hgrc: format: . = where < ...
  • 它可能比你真正需要的更多但是 hg --debug showconfig 会告诉你很多关于从哪里设置的值。 It might be more than you actually need but hg --debug showconfig will tell you quite a bit about what values are being set from where.
  • 如果它的工作方式与在Windows中的工作方式相同,则创建克隆或安装mercurial将不会创建.hgrc或mercurial.ini。 你试过创造它吗? If it works the same way as in windows, creating a clone or installing mercurial will not create a .hgrc or mercurial.ini. Have you tried creating it?
  • 当你克隆时,你不能让人们在他们的.hg/hgrc自动拥有条目 - 这样做可以让某人把rm -rf ~放在一个提交钩子中,对于那个人来说不会是一个糟糕的事情。以前的克隆人。 你可以做的是在'hg目录之外包含一个名为mandatory.hgrc的文件,然后告诉克隆人把这行放在他们的.hg/hgrc : %include ../mandatory.hgrc 虽然那仍然表现出对你的极大信任。 如果您控制机器,就像在许多公司设置中一样,您可以将您的包/部署/更新工具(我们使用puppet)放在/etc/mercur ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)