mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
Net Core - Fix BrowserSubProcess.SelfHost path lookup
- Add Initializer.BrowserSubProcessCorePath which is calculated the same as BrowserSubProcessPath - Update SelfHost to use new path then fallback to old path. Details in https://github.com/cefsharp/CefSharp/issues/3197#issuecomment-757819840
This commit is contained in:
@@ -72,11 +72,18 @@ public class SelfHost
|
||||
return -1;
|
||||
}
|
||||
|
||||
var browserSubprocessDllPath = Path.Combine(Path.GetDirectoryName(typeof(CefSharp.Core.BrowserSettings).Assembly.Location), "CefSharp.BrowserSubprocess.Core.dll");
|
||||
|
||||
#if NETCOREAPP
|
||||
var browserSubprocessDllPath = Initializer.BrowserSubProcessCorePath;
|
||||
if (!File.Exists(browserSubprocessDllPath))
|
||||
{
|
||||
browserSubprocessDllPath = Path.Combine(Path.GetDirectoryName(typeof(CefSharp.Core.BrowserSettings).Assembly.Location), "CefSharp.BrowserSubprocess.Core.dll");
|
||||
}
|
||||
var browserSubprocessDll = System.Runtime.Loader.AssemblyLoadContext.Default.LoadFromAssemblyPath(browserSubprocessDllPath);
|
||||
#else
|
||||
var browserSubprocessDllPath = Path.Combine(Path.GetDirectoryName(typeof(CefSharp.Core.BrowserSettings).Assembly.Location), "CefSharp.BrowserSubprocess.Core.dll");
|
||||
var browserSubprocessDll = System.Reflection.Assembly.LoadFrom(browserSubprocessDllPath);
|
||||
|
||||
#endif
|
||||
var browserSubprocessExecutableType = browserSubprocessDll.GetType("CefSharp.BrowserSubprocess.BrowserSubprocessExecutable");
|
||||
var browserSubprocessExecutable = Activator.CreateInstance(browserSubprocessExecutableType);
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace CefSharp
|
||||
internal static bool LibCefLoaded { get; private set; }
|
||||
internal static string LibCefPath { get; private set; }
|
||||
internal static string BrowserSubProcessPath { get; private set; }
|
||||
internal static string BrowserSubProcessCorePath { get; private set; }
|
||||
|
||||
[ModuleInitializer]
|
||||
internal static void ModuleInitializer()
|
||||
@@ -49,6 +50,8 @@ namespace CefSharp
|
||||
if (LibCefLoaded)
|
||||
{
|
||||
BrowserSubProcessPath = Path.Combine(currentFolder, archFolder, "CefSharp.BrowserSubprocess.exe");
|
||||
BrowserSubProcessCorePath = Path.Combine(currentFolder, archFolder, "CefSharp.BrowserSubprocess.Core.dll");
|
||||
|
||||
LibCefPath = libCefPath;
|
||||
LibCefHandle = handle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user