xUnit doesn’t write message to the output pane

This solution works for me (Visual Studio 2017 and xUnit 2.2.0.3545).

Try adding the below configuration in the App.Config file. (I don’t know why. It was just needed. If it doesn’t exist, just add a new one in your test project.)

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="xunit.diagnosticMessages" value="true"/>
  </appSettings>
</configuration>

The output information will be written in Test output as expected like below.

[xUnit.net 00:00:00.0853907]   Starting:    xxxAssemblyName (parallel test collections = on, max threads = 8)
[xUnit.net 00:00:00.1689373]     Example.xxxTestClassName [PASS]
[xUnit.net 00:00:00.1697265]       Output:
[xUnit.net 00:00:00.1700698]         xxxx your Test Message
[xUnit.net 00:00:00.1797303]   Finished:    xxxAssemblyName

Leave a Comment