diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2017-12-03 10:26:21 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-12-03 10:26:21 +0300 |
commit | 70e9e1fbabd269f3eaa4355fabd09202f2cdb8e9 (patch) | |
tree | 737c5b3c989279f971f3319a9535e5070e2f9b24 /src/System.Private.Reflection.Core | |
parent | ed74e6a7adf67511a17f5c6fbc79a9f90cc7cacc (diff) |
Do not throw if default assembly can't be found (#5058)
Diffstat (limited to 'src/System.Private.Reflection.Core')
-rw-r--r-- | src/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs b/src/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs index 2f1657ed8..361029169 100644 --- a/src/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs +++ b/src/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionDomain.cs @@ -91,7 +91,9 @@ namespace Internal.Reflection.Core.Execution foreach (string defaultAssemblyName in defaultAssemblyNames) { RuntimeAssemblyName runtimeAssemblyName = AssemblyNameParser.Parse(defaultAssemblyName); - RuntimeAssembly defaultAssembly = RuntimeAssembly.GetRuntimeAssembly(runtimeAssemblyName); + RuntimeAssembly defaultAssembly = RuntimeAssembly.GetRuntimeAssemblyIfExists(runtimeAssemblyName); + if (defaultAssembly == null) + continue; Type resolvedType = defaultAssembly.GetTypeCore(coreTypeName, ignoreCase: ignoreCase); if (resolvedType != null) return resolvedType; |