Skip to content

Commit aa85d8c

Browse files
MattFromRVAAndreyAkinshin
authored andcommitted
Added new Exception
1 parent 7dacb16 commit aa85d8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BenchmarkDotNet/Diagnosers/DiagnosersLoader.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ private static IDiagnoser[] LoadWindowsDiagnosers()
8080
CreateDiagnoser(diagnosticsAssembly, "BenchmarkDotNet.Diagnostics.Windows.NativeMemoryProfiler")
8181
};
8282
}
83+
catch (Exception ex) when (ex is FileNotFoundException || ex is BadImageFormatException)
84+
{
85+
// Return an array of UnresolvedDiagnoser objects when the assembly does not contain the requested diagnoser
86+
return new[] { GetUnresolvedDiagnoser<IDiagnoser>() };
87+
}
8388
catch (Exception ex) // we're loading a plug-in, better to be safe rather than sorry
8489
{
8590
ConsoleLogger.Default.WriteLineError($"Error loading {WindowsDiagnosticAssemblyFileName}: {ex.GetType().Name} - {ex.Message}");

0 commit comments

Comments
 (0)