From 90f0f7199d67979eb9d95c482993d48617c7d3d0 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 2 Dec 2017 12:15:58 +0100 Subject: [PATCH] Fix #1004: Crashed when ref to mscorlib, Version=65535.65535.65535.65535, Culture=neutral, PublicKeyToken=b77a5c561934e089 --- .../DotNetCore/UniversalAssemblyResolver.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.Decompiler/DotNetCore/UniversalAssemblyResolver.cs b/ICSharpCode.Decompiler/DotNetCore/UniversalAssemblyResolver.cs index b10c5166c..c4bd5834f 100644 --- a/ICSharpCode.Decompiler/DotNetCore/UniversalAssemblyResolver.cs +++ b/ICSharpCode.Decompiler/DotNetCore/UniversalAssemblyResolver.cs @@ -211,8 +211,11 @@ namespace ICSharpCode.Decompiler path = Path.Combine(path, "2.0"); } else if (version.Major == 4) path = Path.Combine(path, "4.0"); - else - throw new NotSupportedException("Version not supported: " + version); + else { + if (throwOnError) + throw new NotSupportedException("Version not supported: " + version); + return null; + } } else { switch (version.Major) { case 1: @@ -228,7 +231,9 @@ namespace ICSharpCode.Decompiler path = Path.Combine(path, "v4.0.30319"); break; default: - throw new NotSupportedException("Version not supported: " + version); + if (throwOnError) + throw new NotSupportedException("Version not supported: " + version); + return null; } }