From 4070f37310320785330bb8aa0e46930b258c77d0 Mon Sep 17 00:00:00 2001 From: dingmeng-xue Date: Mon, 21 Dec 2020 20:34:33 +0800 Subject: [PATCH] Load assemblies from PreloadAssemblies --- tools/Tools.Common/Loaders/CmdletLoader.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/Tools.Common/Loaders/CmdletLoader.cs b/tools/Tools.Common/Loaders/CmdletLoader.cs index afda68441bd0..63edae07607b 100644 --- a/tools/Tools.Common/Loaders/CmdletLoader.cs +++ b/tools/Tools.Common/Loaders/CmdletLoader.cs @@ -40,6 +40,10 @@ public ModuleMetadata GetModuleMetadata(string assemblyPath, List common { var assemblyName = args.Name.Substring(0, args.Name.IndexOf(",")); var dll = Directory.GetFiles(commonOutputFolder, "*.dll").FirstOrDefault(f => Path.GetFileNameWithoutExtension(f) == assemblyName); + if (dll == null && Directory.Exists(commonOutputFolder + "\\PreloadAssemblies")) + { + dll = Directory.GetFiles(commonOutputFolder + "\\PreloadAssemblies", "*.dll").FirstOrDefault(f => Path.GetFileNameWithoutExtension(f) == assemblyName); + } if (dll == null) { continue; @@ -212,7 +216,7 @@ public ModuleMetadata GetModuleMetadata(string assemblyPath) } catch (Exception ex) { - throw ex; + throw; } ModuleMetadata.Cmdlets = results;