编辑:好的,愚蠢的我!更新包不会更新我自定义位置的文件(显然!(。修复它,一切都很甜蜜!
我有一个基于WinForms的cefsharp应用程序正在运行。我更新了CefSharp的NuGet软件包(到75.1.142.0(,现在浏览器在启动时只显示空白。日志文件显示:
[1029/115545.989:WARNING:resource_bundle.cc(952)] unable to find resource: 164
[1029/115546.193:ERROR:viz_main_impl.cc(170)] Exiting GPU process due to errors during initialization
[1029/115546.210:WARNING:gpu_process_host.cc(1205)] The GPU process has crashed 1 time(s)
有没有办法获得更详细的调试信息?
我找到了答案,但我不确定为什么应该这样。我在CefSharpSettings中评论了路径的设置(如下(,现在它起作用了吗?
private static void LoadForm(string[] args)
{
// Alternate file locations
string browser = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharpCefSharp.BrowserSubprocess.exe");
string locales = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharplocales");
string res = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharp");
string cache = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharpcache");
// Initialise CEF
CefSharpSettings.SubprocessExitIfParentProcessClosed = true;
CefSharp.CefSharpSettings.LegacyJavascriptBindingEnabled = true;
CefSettings settings = new CefSettings();
settings.CachePath = cache;
settings.MultiThreadedMessageLoop = true;
settings.ExternalMessagePump = false;
settings.RemoteDebuggingPort = 8088;
settings.CefCommandLineArgs.Add("proxy-auto-detect", "true");
settings.LogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharpDebug.log");
//settings.BrowserSubprocessPath = browser;
//settings.LocalesDirPath = locales;
//settings.ResourcesDirPath = res;
settings.DisableGpuAcceleration();
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
Application.Run(new ImportForm(args));
}