I have a set of mstest unit tests, which use Trace.Write to collect some debugging information. And when I run it from VS2010 and then go to Test Run Details, there’s Debug Trace section where I can see all my messages.
But when I run the same test from command line on the build machine, the trace is not recorded.
The things that I’ve tried:
- Make sure that I’m in Debug configuration
- /details command line switch with debugtrace, traceinfo etc options
- I know about saving the traces to the file on the disk through the listeners, but I would like to find a solution to write
Has someone had a similar problem?
Try using
Console.WriteLineinstead. I’ve had this problem before withMSTest, and using theWriteLineworked for me – in that there was output available in the test result view.No idea what other things like
Debug.WriteLineorTrace.WriteLinedidn’t work, I never bothered to found out to be honest. (Well, I stopped usingMSTestand moved toNUnit)