can't see Debug.Write output

Topics: ReSharper test runner
May 3, 2010 at 9:17 PM


Running an XUnit-based unit test from VS using the contrib runner.  I've noticed that Debug.Write output doesn't show up in the output window.  I've confirmed that the Debug constant is enabled.  Here's the strange part: when I reference the assembly that I'm testing from a dummy console app (the app simply calls 1 method in the assembly), Debug.Write output appears just fine in the output window.  So somehow the xUnit runner or xUnit itself is discarding Debug.Write statements.

pulling my hair out on this one!


May 5, 2010 at 1:42 PM

found a solution. simply add the following to any test: Debug.Listeners.Add(new DefaultTraceListener());

May 24, 2010 at 9:03 PM

I believe this is a bug in xunit.dll 1.5. If you get the latest version of xunit souce, rebuild and reference in your project, it should work without having to add your own listener.

May 28, 2010 at 3:46 AM