Skip to content

Commit 5214ca1

Browse files
committed
fix: Check both, PWSH_ROOT_PATH and CurrentDirectory for assemblies
1 parent 56b4f6c commit 5214ca1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

SharpShell.Loader/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ static void Main(string[] args)
2727
return AssemblyLoadContext.Default.LoadFromStream(ms);
2828
}
2929

30-
var dllLocalPath = Path.Combine(rootPath, name + ".dll");
30+
var dllLocalPath = Path.Combine(Directory.GetCurrentDirectory(), name + ".dll");
31+
if (!File.Exists(dllLocalPath)) {
32+
// File does exist in current dir, let's assemble path with pwsh root
33+
dllLocalPath = Path.Combine(rootPath, name + ".dll");
34+
}
35+
3136
if (BlacklistedDependencies.Contains(name))
3237
return AssemblyLoadContext.Default.LoadFromAssemblyPath(dllLocalPath);
3338

0 commit comments

Comments
 (0)