Skip to content

Cef.Initialize starts a new instance of the calling process and fails to initialize in the current process in version 138.0.340.0 #5152

@tjarnagin

Description

@tjarnagin

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

138.0.340.0

Operating System

Windows 10

Architecture

x64

.Net Version

.Net Framework 4.7.2

Implementation

WPF

Reproduction Steps

Create a .NET Framework WBP application and do something similar to the following in the startup:

        var localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
        var callingAssembly = Assembly.GetEntryAssembly().GetName().Name;
        var currentProcess = System.Diagnostics.Process.GetCurrentProcess();
        callingAssembly += $".{currentProcess.Id}";

        var cefSharpCachePath = Path.Combine(localAppDataPath, _cefSharpFolder, _cefSharpCacheFolder, callingAssembly);

        var settings = new CefSettings();
        settings.CachePath = cefSharpCachePath;
        settings.LogFile = "C:\\CefSharpLogs\\CefSharpLog.log";
        settings.LogSeverity = LogSeverity.Verbose;

#if DEBUG
settings.RemoteDebuggingPort = 8088;
#endif

        settings.BrowserSubprocessPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
                                               "CefSharp.BrowserSubprocess.exe");

        var initialized = Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null);
        if (!initialized)
        {
            var exitCode = Cef.GetExitCode();
        }

Expected behavior

?

Actual behavior

Our .NET Frameworks WPF apps have always create a unique to the process instance cache path. Our last working version was 135.0.170.0. In 138.0.340.0 Cef.Initialize immediately starts a new instance of my app which starts up with no issues but the initial call to Initialize returns false with and exit code of 38. Currently 38 is not defined in CefSharp.Enums.ResultCode. I then have two instances running, each with there own cache path. The original starting process cannot instantiate an instance of the browser since Cef.IsIntialized is false.

Version 138.0.170.0 is doing the same but a fatal exception is thrown from Initialize which shuts down the process. The secondary process open without issue.

I will continue dropping the version until the behavior stops and report.

Attached if the verbose CefSharp log from version 138.0.170.0

CefSharpLog.log

Regression?

No response

Known Workarounds

No response

Does this problem also occur in the CEF Sample Application

Not Tested

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions