Cefsharp Winforms应用显示空白浏览器

问题描述 投票:0回答:1

我有一个正在运行的基于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)

有没有办法获得更详细的调试信息?

cefsharp chromium-embedded
1个回答
0
投票

编辑:好-愚蠢的我!更新软件包不会更新我自定义位置中的文件(显然!)。解决这个问题,一切都会变得很美好!

我找到了答案,但是我不确定为什么要这样。我注释掉了CefSharpSettings中的路径设置(如下所示),现在可以了吗?

private static void LoadForm(string[] args)
{
        // Alternate file locations
        string browser = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharp\CefSharp.BrowserSubprocess.exe");
        string locales = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharp\locales\");
        string res = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharp\");
        string cache = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CEFSharp\cache\");

        // 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, @"CEFSharp\Debug.log");
        //settings.BrowserSubprocessPath = browser;
        //settings.LocalesDirPath = locales;
        //settings.ResourcesDirPath = res;
        settings.DisableGpuAcceleration();
        Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);

        Application.Run(new ImportForm(args));
    }
© www.soinside.com 2019 - 2024. All rights reserved.