My goal is to view log output in Visual Studio 2019 Pro, for all unit tests, while the tests are running.
I tried log4net. The log writes to an output file, via log4net.Appender.FileAppender, so I know log4net is configured and running. However, output sent to log4net.Appender.OutputDebugStringAppender and log4net.Appender.ConsoleAppender do not appear in the Visual Studio Output Window, or DebugView++.
I tried writing via Console.WriteLine.
I also tried
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
Trace.AutoFlush = true;
System.Diagnostics.Trace.TraceInformation("hello");
This output appears correctly when I
run a test
select the test in Test Explorer in VS
Click the "Open additional output for this result" link
so I know the code is working.
But I don't want to have to click each test to see the results.
I want to see all the log output, in the Output Window in VS, while the tests are running.
I tried running the tests in both Debug and Release modes.
How to do this?
Thanks!
Adam Leffert
https://www.fullstackdeveloper.com