Closed bkqc closed 2 years ago
This post explains the reason why ConsoleTraceListener in the app.config does not work natively but the custom filewriter listener does. https://stackoverflow.com/questions/71758259/trace-to-mstest-v2-test-log-using-tracesource/72324658
Description
I have a project in which I have tracing to TraceSources. I would like to have the output of it logged in the test explorer report window.
Steps to reproduce
Create a SUT in which you do something like
Expected behavior
In the Test Explorer window, for the tests that executed, even for DataTests, get "My trace text" in the test report.
Actual behavior
System.Diagnostics.ConsoleTraceListener
is set for the right source, only the first test of the whole test suite gets its StdOut text, no matter if the suite is made of a single tests, multiple, a data test or a combination of everything. More precisely, the first test is the only one to gets anything written and the only text it gets is from its own test. There is no crosstalk between tests.Environment
Windows 10 VS 2019 (16.11.10) FW 4.8.04084 MSTest.TestAdapter 2.2.8 MSTest.TestFramework 2.2.8