Guard TrackAssembly

Because it can fail sometimes
This commit is contained in:
Andrew Schwartzmeyer
2015-11-23 17:54:30 -08:00
parent 649629a18f
commit b9f069cb22
+12 -4
View File
@@ -3,6 +3,7 @@ namespace Microsoft.PowerShell.Linux.Host
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Management.Automation;
@@ -76,11 +77,18 @@ namespace Microsoft.PowerShell.Linux.Host
{
if (assembly != null)
{
// Console.WriteLine(assembly.Location);
// Console.WriteLine(assembly.ExportedTypes.Count());
foreach (var type in assembly.ExportedTypes)
try
{
TrackType(type.FullName, assembly);
// Console.WriteLine(assembly.Location);
// Console.WriteLine(assembly.ExportedTypes.Count());
foreach (var type in assembly.ExportedTypes)
{
TrackType(type.FullName, assembly);
}
}
catch (System.IO.FileNotFoundException)
{
Debug.WriteLine("Could not track assembly {0}", assembly.Location);
}
}
}