Skip to content

Commit

Permalink
Load assemblies from PreloadAssemblies (#13799)
Browse files Browse the repository at this point in the history
  • Loading branch information
dingmeng-xue authored Dec 21, 2020
1 parent 3d9ca1d commit cfa3c8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/Tools.Common/Loaders/CmdletLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public ModuleMetadata GetModuleMetadata(string assemblyPath, List<string> 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;
Expand Down Expand Up @@ -212,7 +216,7 @@ public ModuleMetadata GetModuleMetadata(string assemblyPath)
}
catch (Exception ex)
{
throw ex;
throw;
}

ModuleMetadata.Cmdlets = results;
Expand Down

0 comments on commit cfa3c8e

Please sign in to comment.