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.
-
通过MacPorts安装Mercurial后找不到〜/ .hgrc文件(Cannot find ~/.hgrc file after Mercurial installation via MacPorts)[2022-06-30]
如果它的工作方式与在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 ...