Skip to content

Commit cfa3c8e

Browse files
authored
Load assemblies from PreloadAssemblies (#13799)
1 parent 3d9ca1d commit cfa3c8e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/Tools.Common/Loaders/CmdletLoader.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public ModuleMetadata GetModuleMetadata(string assemblyPath, List<string> common
4040
{
4141
var assemblyName = args.Name.Substring(0, args.Name.IndexOf(","));
4242
var dll = Directory.GetFiles(commonOutputFolder, "*.dll").FirstOrDefault(f => Path.GetFileNameWithoutExtension(f) == assemblyName);
43+
if (dll == null && Directory.Exists(commonOutputFolder + "\\PreloadAssemblies"))
44+
{
45+
dll = Directory.GetFiles(commonOutputFolder + "\\PreloadAssemblies", "*.dll").FirstOrDefault(f => Path.GetFileNameWithoutExtension(f) == assemblyName);
46+
}
4347
if (dll == null)
4448
{
4549
continue;
@@ -212,7 +216,7 @@ public ModuleMetadata GetModuleMetadata(string assemblyPath)
212216
}
213217
catch (Exception ex)
214218
{
215-
throw ex;
219+
throw;
216220
}
217221

218222
ModuleMetadata.Cmdlets = results;

0 commit comments

Comments
 (0)