Skip to content

Commit 2bf721a

Browse files
committed
Better error message for debugging here
1 parent 7e8af73 commit 2bf721a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Test/EditorUtilsTest/EditorHostTest.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.VisualStudio.Text.Outlining;
99
using Microsoft.VisualStudio.Text.Projection;
1010
using Microsoft.VisualStudio.Utilities;
11+
using System.Reflection;
1112

1213
namespace EditorUtils.UnitTest
1314
{
@@ -90,7 +91,22 @@ public TestableSynchronizationContext TestableSynchronizationContext
9091

9192
public EditorHostTest()
9293
{
93-
_editorHost = GetOrCreateEditorHost();
94+
try
95+
{
96+
_editorHost = GetOrCreateEditorHost();
97+
}
98+
catch (ReflectionTypeLoadException e)
99+
{
100+
// When this fails in AppVeyor the error message is useless. Need to construct a more actionable
101+
// error message here.
102+
var builder = new StringBuilder();
103+
builder.AppendLine(e.Message);
104+
foreach (var item in e.LoaderExceptions)
105+
{
106+
builder.AppendLine(item.Message);
107+
}
108+
throw new Exception(builder.ToString(), e);
109+
}
94110
_synchronizationContext = new TestableSynchronizationContext();
95111
_synchronizationContext.Install();
96112
}

0 commit comments

Comments
 (0)