Skip to content

Commit

Permalink
fix: Use AppContext.BaseDirectory instead of Environment.CurrentDirec…
Browse files Browse the repository at this point in the history
…tory (#21797)

#21750
---------
Co-authored-by: Eilon Lipton <Eilon@users.noreply.github.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
  • Loading branch information
3 people authored Apr 17, 2024
1 parent a7aeade commit d6a3c50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BlazorWebView/src/WindowsForms/BlazorWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private void StartWebViewCoreIfPossible()
}
else
{
appRootDir = Environment.CurrentDirectory;
appRootDir = AppContext.BaseDirectory;
}
var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage!)); // HostPage is nonnull because RequiredStartupPropertiesSet is checked above
var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!;
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorWebView/src/Wpf/BlazorWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private void StartWebViewCoreIfPossible()
}
else
{
appRootDir = Environment.CurrentDirectory;
appRootDir = AppContext.BaseDirectory;
}
var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage));
var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!;
Expand Down

0 comments on commit d6a3c50

Please sign in to comment.