Skip to content

Commit 088fdb6

Browse files
committed
Use AppDomain instead of Assembly.Location
As the latter can return a VSS cached location.
1 parent b4c6ea6 commit 088fdb6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.PowerShell.EditorServices.Services.PowerShellContext
1818
internal class PSReadLinePromptContext : IPromptContext
1919
{
2020
private static readonly string _psReadLineModulePath = Path.Combine(
21-
Path.GetDirectoryName(typeof(PSReadLinePromptContext).Assembly.Location),
21+
AppContext.BaseDirectory,
2222
"..",
2323
"..",
2424
"..",
@@ -27,7 +27,7 @@ internal class PSReadLinePromptContext : IPromptContext
2727
// When using xUnit (dotnet test) the assemblies are deployed to the
2828
// test project folder, invalidating our relative path assumption.
2929
private static readonly string _psReadLineTestModulePath = Path.Combine(
30-
Path.GetDirectoryName(typeof(PSReadLinePromptContext).Assembly.Location),
30+
AppContext.BaseDirectory,
3131
"..",
3232
"..",
3333
"..",
@@ -89,6 +89,7 @@ internal static bool TryGetPSReadLineProxy(
8989
{
9090
readLineProxy = null;
9191
logger.LogTrace("Attempting to load PSReadLine");
92+
Console.WriteLine($"{_psReadLineModulePath} / {_psReadLineTestModulePath}");
9293
using (var pwsh = PowerShell.Create())
9394
{
9495
pwsh.Runspace = runspace;

0 commit comments

Comments
 (0)