Investigate why stacktrace are empty in release mode
Some tests are checking the StackTrace and it's either null or empty when in release mode. We have some helper doing cleanup of them so I am wondering if the logic is not working properly with MTP as the processing is different (more "normal" app like).
AB#2404445
Issues talks about this PR https://github.com/microsoft/testfx/pull/5014 , and the assertions wrapped in if #DEBUG
Leaving a note here: we are targeting net462:
https://github.com/microsoft/testfx/blob/bb3c852afe2e5a43795b9fdbee6f14b445a6d29e/test/UnitTests/MSTestAdapter.UnitTests/MSTestAdapter.UnitTests.csproj#L5
So one important difference that happens with the move from VSTest to MTP is that testhost.exe.config has:
<AppContextSwitchOverrides value="Switch.System.Diagnostics.IgnorePortablePDBsInStackTraces=false" />
which is linked to https://github.com/dotnet/designs/blob/238ca0202ea5df96d378a06c01960fc289aba166/accepted/2020/diagnostics/debugging-with-symbols-and-sources.md#stack-traces.
That's one possible area to look at.
This happens only under code coverage, specifically with our coverage.config. More specifically, removing the ModulePaths element in the config file resolves it.
Ping @fhnaseer