mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Guard TrackAssembly
Because it can fail sometimes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user