diff --git a/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs b/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs index 7db2f79fb6..117ea85380 100644 --- a/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs +++ b/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs @@ -160,7 +160,7 @@ internal static string GetLoadExceptionDetails(ReflectionTypeLoadException ex) var map = new Dictionary(StringComparer.OrdinalIgnoreCase); // Exception -> null. var errorDetails = new StringBuilder(); - if (ex.LoaderExceptions != null) + if (ex.LoaderExceptions?.Length > 0) { // Loader exceptions can contain duplicates, leave only unique exceptions. foreach (var loaderException in ex.LoaderExceptions) diff --git a/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/MSTest.CoreAdapter.Unit.Tests.csproj b/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/MSTest.CoreAdapter.Unit.Tests.csproj index baa20620ee..29d3c57954 100644 --- a/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/MSTest.CoreAdapter.Unit.Tests.csproj +++ b/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/MSTest.CoreAdapter.Unit.Tests.csproj @@ -2,10 +2,16 @@ - net462 + net48 + net462;$(NetStandardNetFrameworkHolder);netcoreapp3.1;net6.0;$(WinUiMinimum) + true Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests - UnitTest + + + + + $(DefineConstants);WIN_UI @@ -15,14 +21,14 @@ pdbonly + + + + - - +