Skip to content

Commit 5b7af3f

Browse files
authored
Use Assembly.LoadFile in WinPS (#1227)
1 parent ce265d7 commit 5b7af3f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public static EditorServicesLoader Create(
119119
{
120120
logger.Log(
121121
PsesLogLevel.Diagnostic,
122-
$"Loaded {args.LoadedAssembly.GetName()}");
122+
$"Loaded '{args.LoadedAssembly.GetName()}' from '{args.LoadedAssembly.Location}'");
123123
};
124124
}
125125

@@ -135,16 +135,16 @@ public static EditorServicesLoader Create(
135135
string baseDirAsmPath = Path.Combine(s_psesBaseDirPath, dllName);
136136
if (File.Exists(baseDirAsmPath))
137137
{
138-
logger.Log(PsesLogLevel.Diagnostic, $"Loading {args.Name} from PSES base dir into LoadFrom context");
139-
return Assembly.LoadFrom(baseDirAsmPath);
138+
logger.Log(PsesLogLevel.Diagnostic, $"Loading {args.Name} from PSES base dir into LoadFile context");
139+
return Assembly.LoadFile(baseDirAsmPath);
140140
}
141141

142142
// Then look in the shared .NET Standard directory
143143
string asmPath = Path.Combine(s_psesDependencyDirPath, dllName);
144144
if (File.Exists(asmPath))
145145
{
146-
logger.Log(PsesLogLevel.Diagnostic, $"Loading {args.Name} from PSES dependency dir into LoadFrom context");
147-
return Assembly.LoadFrom(asmPath);
146+
logger.Log(PsesLogLevel.Diagnostic, $"Loading {args.Name} from PSES dependency dir into LoadFile context");
147+
return Assembly.LoadFile(asmPath);
148148
}
149149

150150
return null;

0 commit comments

Comments
 (0)