When I ran tests in prior versions of Visual Studio Test Explorer and there was a problem that caused the build runner to crash (such as AccessViolationException
, StackOverflowException
, OutOfMemoryException
, etc), it would output a message displaying the exception type thrown and how to enable a log to get more details.
With Visual Studio 2017 Community Edition version 15.3.2 and .NET Core 1.0, when there is a crash all that is shown in the Test Output is:
[8/30/2017 3:03:42 AM Error] The active Tests Run was aborted.
[8/30/2017 3:03:42 AM Informational] ========== Run test finished: 1030 run (0:41:12.5762484) ==========
How can I determine what type of exception caused the build runner to crash (preferably with a stack trace)?
NOTE: I have opened an issue with NUnit during this investigation asking about how to determine which tests are causing the crash. I have already isolated (and worked around) 2 of the causes.
- .NET Core 2.0 crashes fatally when a
Debug.Assert
fails - The test runner was running out of virtual memory due to running under 32 bit.
But there is still at least one more issue causing a crash. I am trying to work out why the test runner crashes in Visual Studio 2017 but does not crash on the command line.
Also note that this particular crash does not happen when running on .NET Framework, so suggestions to use command line tools that don't support .NET Core 1.0 or .NET Core 2.0 (such as vstest.console.exe
) are not helpful.