Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/BlazorWebView/src/WindowsForms/BlazorWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.AppContext;
using Microsoft.AspNetCore.Components.WebView.WebView2;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
Expand Down Expand Up @@ -177,7 +178,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
3 changes: 2 additions & 1 deletion src/BlazorWebView/src/Wpf/BlazorWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.AppContext;
using Microsoft.AspNetCore.Components.WebView.WebView2;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
Expand Down Expand Up @@ -262,7 +263,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