From 77b6b12adac9d935957dcb4c7177b1e1864e9925 Mon Sep 17 00:00:00 2001 From: George Fleming Date: Wed, 6 Apr 2016 08:44:03 -0700 Subject: [PATCH] ipmo fails to load personal module --- .../CoreCLR/CorePsAssemblyLoadContext.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs index 9225655743e..7d6145dfc23 100644 --- a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs @@ -250,7 +250,14 @@ internal Assembly LoadFrom(string assemblyPath) // Try loading it from the TPA list. All PowerShell dependencies are in the // TPA list when published with dotnet-cli. - asmLoaded = Assembly.Load(assemblyName); + try + { + asmLoaded = Assembly.Load(assemblyName); + } + catch + { + asmLoaded = null; + } if (asmLoaded == null) { @@ -520,4 +527,4 @@ public static void SetPowerShellAssemblyLoadContext([MarshalAs(stringType)]strin } } -#endif \ No newline at end of file +#endif