I have a test using NHibernate that outputs a bunch of NHibernate-specific logging (sql statements etc.) when I run it via ReSharper's test runner or NUnit's GUI runner. Example:
However when I run it via NCrunch the output is only displaying the log4net debug info and the my own log entries, none of the log entries for NHibernate. Example:
My suspicion is that there is an implicit reference between the log4net code and the NHibernate logger. Most likely log4net is searching for additional loggers within your build output directory by scanning through adjacent assemblies that export a particular interface, or it's referencing the NHibernate logger DLL using a configuration file. I can't confirm 100% that this is the case without running through the log4net/NHibernate source code myself, but it would probably make sense.
Because NCrunch isolates components in their own workspaces, the above code wouldn't find the NHibernate logger as the binary wouldn't be stored in the right place. Turning on the 'Copy referenced assemblies to workspace' emulates normal behaviour and thus allows the code to work.
You'll need to make a decision as to whether or not you wish to continue using the 'Copy referenced assemblies to workspace' setting. If your solution is large, this setting can result in greatly elevated build times and is generally best avoided. You might want to look at other ways of registering the NHibernate logger with with log4net - from memory, there are many different ways of doing this. If you can do it using SetUp code within your tests, this may allow you to cleanly work around the problem.
For the record, it was sufficient explicitly copying NHibernate.dll and log4net.dll, which has a lot less impact on build time than the "Copy referenced assemblies to workspace" option.
Good to know! Did you manage this using a custom build step? I'm wondering if it's an option worth suggesting to people as a more performance-friendly alternative to the 'Copy referenced assemblies to workspace' setting.