Sunday, 21 September 2025

NUnit TestFixture logging with vstest and Microsoft.Testing.Platform

When using vstest or Microsoft.Testing.Platform on the command line, NUnit won't log `TestContext.Out` from a `TestFixture`, or, to be more specific, when outside of a `TestMethod`.

You will see the output in UI tools like ReSharper, however, when running the tests on the command line, only logs written inside a test method will show in the console.

This is due to buffering test logs for tests running in parallel so the logs are not interleaved, plus the lack of hierarchical logging support in vstest and Microsoft.Testing.Platform.

The solution is to use `TestContext.Progress` which will write straight out to the console.

NUnit TestFixture logging with vstest and Microsoft.Testing.Platform

When using vstest or Microsoft.Testing.Platform on the command line, NUnit won't log `TestContext.Out` from a `TestFixture`, or, to be m...