summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs')
-rw-r--r--src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs
index 9d34b48..49a5518 100644
--- a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs
+++ b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs
@@ -52,7 +52,19 @@ namespace System.Reflection
string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath), requestedAssemblyName.Name+".dll");
// Load the dependency via LoadFrom so that it goes through the same path of being in the LoadFrom list.
- return Assembly.LoadFrom(requestedAssemblyPath);
+ Assembly resolvedAssembly = null;
+
+ try
+ {
+ resolvedAssembly = Assembly.LoadFrom(requestedAssemblyPath);
+ }
+ catch(FileNotFoundException)
+ {
+ // Catch FileNotFoundException when attempting to resolve assemblies via this handler to account for missing assemblies.
+ resolvedAssembly = null;
+ }
+
+ return resolvedAssembly;
}
public static Assembly LoadFrom(String assemblyFile)