Skip to content

Commit 5f32c99

Browse files
committed
clrcore: only print assembly loading exceptions if the assembly could not be loaded
1 parent 472c4df commit 5f32c99

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

code/client/clrcore/InternalManager.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ static Assembly LoadAssemblyInternal(string baseName, bool useSearchPaths = fals
142142
var attemptPaths = new List<string>();
143143
attemptPaths.Add(baseName);
144144

145+
var exceptions = new StringBuilder();
146+
145147
if (useSearchPaths)
146148
{
147149
foreach (var path in ms_assemblySearchPaths)
@@ -196,11 +198,11 @@ static Assembly LoadAssemblyInternal(string baseName, bool useSearchPaths = fals
196198
if (e is FileNotFoundException && string.Equals(name, "I18N", StringComparison.OrdinalIgnoreCase))
197199
throw new NotImplementedException("I18N not found", e);
198200

199-
Debug.WriteLine($"Exception loading assembly {name}: {e}");
201+
exceptions.AppendLine($"Exception loading assembly {name}: {e}");
200202
}
201203
}
202204

203-
Debug.WriteLine($"Could not load assembly {baseName} - see above for loading exceptions.");
205+
Debug.WriteLine($"Could not load assembly {baseName} - loading exceptions: {exceptions}");
204206

205207
return null;
206208
}

0 commit comments

Comments
 (0)