From e243f3ca1d97e30b4829a6f1b2d65458d65d5430 Mon Sep 17 00:00:00 2001 From: Gyuwon Date: Sat, 1 Jun 2019 00:23:31 +0900 Subject: [PATCH] Bypass VSTest bug Bypass the problem that the test runner cannot load types from assembly 'Microsoft.VisualStuduo.TraceDataCollector'. https://github.com/microsoft/vstest/issues/2008 --- source/Loom.Messaging/TypeResolver.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/Loom.Messaging/TypeResolver.cs b/source/Loom.Messaging/TypeResolver.cs index b20fa68..debca33 100644 --- a/source/Loom.Messaging/TypeResolver.cs +++ b/source/Loom.Messaging/TypeResolver.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; + using System.Reflection; public sealed class TypeResolver { @@ -29,8 +30,16 @@ private static ImmutableArray GetAllTypes() { AppDomain appDomain = AppDomain.CurrentDomain; - IEnumerable query = + // TODO: Remove the code to bypass the damn error after it fixed. + // https://github.com/microsoft/vstest/issues/2008 + string filter = "Microsoft.VisualStudio.TraceDataCollector"; + IEnumerable assemblies = from assembly in appDomain.GetAssemblies() + where assembly.FullName.StartsWith(filter) == false + select assembly; + + IEnumerable query = + from assembly in assemblies from type in assembly.GetTypes() select type;